4

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 <%**=** %> ?

Community
  • 1
  • 1

1 Answers1

2

<%# %> 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).

Aaron Powell
  • 24,927
  • 18
  • 98
  • 150