<%# vs. <%=

CJLeit

Freshman
Joined
Feb 1, 2006
Messages
32
I'm modifying an existing .net website and in the HTML the previous developer using <%# Function Name %> several times in his HTML to call a function and return the value to the screen. I've always used <%= Function Name %>to do the same thing. Is there a difference in the 2 methods of doing this?

Thanks!
 
ASP.Net tags

Code enclosed by <% ... %> is just executed, while code enclosed by <%= ... %> is evaluated and the result is emitted as content. Code located within a <%# ... %> code block is only executed when the DataBind method of its parent control container is invoked.

Good luck :cool:
 
Back
Top