Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Forms Inline Code Begin Tags

Tags:

.net

asp.net

I just wan to to know why these different begin tags exist, if there are still more and if they can be used interchangeably:

<%# Do.Something() %>
<%= Do.Something() %>
...
like image 574
timmkrause Avatar asked Dec 19 '25 03:12

timmkrause


1 Answers

The tags do different things. For example <%= %> will write the result of the expression within the tags to the output, while <%# %> will use data-binding expressions to reference data from a data source. A fuller explanation can be found at http://weblogs.asp.net/ahmedmoosa/archive/2010/10/06/embedded-code-and-inline-server-tags.aspx

like image 69
tvanfosson Avatar answered Dec 21 '25 00:12

tvanfosson