06 April 2011

The CodeExpressionBuilder - Infinities Loop

The CodeExpressionBuilder - Infinities Loop: "THE CODEEXPRESSIONBUILDER
A very exciting new feature in ASP.NET 2.0 is Expression Builders. Expression builders allow for some pretty interesting interaction with the ASP.NET compilation model.

For example, new to ASP.NET 2.0 is the ability to reference appSettings declaratively. Lets say you wanted the text of a button to be based on a value in the appSettings section of your web.config. Piece of cake:"

[ASP.NET] <%# %> vs <%= %> - Stack Overflow

[ASP.NET] <%# %> vs <%= %> - Stack Overflow: "<%= ... %> is generally equivalent to Response.Write(...) it cannot be used in a control attribute that is runat='server'

<%: ... %> (as of .NET v4.0) is an html encoded version of <%= %> (as @Eric mentions)

<%# ... %> is used in data-binding context for Bind, Eval or Output (as @Ray mentions)"