Possible Duplicate:
ASP.NET “special” tags
You know how you can embed property value from code-behind in your page by simply using <%= PropertyFromCodeBehind %> in your .aspx?
Well, I only recently discovered that and I can’t seem to find any tutorial that would explain this (and related stuff) in more depth (I only know that <%# is used in conjuction with Eval) – probably because I’m using <% for searches.
So, can anybody provide me with more detail explanation of these tags, or give a link to some tutorial that explains all this? I’m interested in anything that can be learned on this subject; somewhere I saw that you can do fancy stuff like <% for … %>.
Here is a good place to get started.
There are several different syntaxes:
<%$ %>Expression Syntax<%# %>Data-Binding syntax<% %>Evaluated Code Blocks<%= %>Statement and ExpressionNew to ASP.NET 4 is the HTML encoding syntax (haacked). This is the same as
<%= %>except the result is HTML encoded (for nonIHtmlStringtypes). The new syntax is intended to replace<%= %>.<%: %>HTML Encoded output