Duplicate: ASP.NET "special" tags
I work with PHP which uses <? ?>
or <?php ?>
as server tags, but what is the meaning and usage in ASP.NET's <%**#** %>
and <%**=** %>
?
Duplicate: ASP.NET "special" tags
I work with PHP which uses <? ?>
or <?php ?>
as server tags, but what is the meaning and usage in ASP.NET's <%**#** %>
and <%**=** %>
?
<%# %>
indicates a data binding operation and is only valid within DataBinding controls (such as a DataGrid, ListView, etc).
<%= %>
is a shortcut to HttpContext.Current.Response.Write
. It'll call the .ToString()
method on any object/ method call (execpt for strings, it may be smart enough to not ToString a string).