asp.net - Whats the meaning of this syntax in Visual studio -


this question has answer here:

does know meaning of following 4 code snipets (or shortcuts, don't know how call them) in visual studio:

<%= variable %> <%# variable %> <%: variable %> <%$ variable %> 

i know first 1 inserts value page , second 1 used data binding.

are there other similar shortcuts?

the first one, <%= %> called inline expression, or code render block. (http://msdn.microsoft.com/en-us/library/k6xeyd4z(v=vs.100).aspx)

the second one, <%# %> called data binding expression. (http://msdn.microsoft.com/en-us/library/bda9bbfx(v=vs.100).aspx)

the third one, <%: %> provides way automatically html encode output of code. i'm not sure what's it's called though can't find documentation page on it, there post on scott guthrie's blog: http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx

the fourth one, <%$ %> called expression builder syntax. (http://msdn.microsoft.com/en-us/library/d5bd1tad(v=vs.100).aspx)


Comments