tags:

views:

142

answers:

2

Duplicate: http://stackoverflow.com/questions/649428/asp-net-special-tags


I work with PHP who using or for server tag ,but what the meaning and usage in ASP.NET's <%# %> and <%= %> ??

thanks you.

A: 

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

Slace