In ASP.NET 4.0
should I use new syntax <%: expression %>
or 2.0 <%= HttpUtility.HtmlEncode(expression) %>
In ASP.NET 4.0
should I use new syntax <%: expression %>
or 2.0 <%= HttpUtility.HtmlEncode(expression) %>
Less keystrokes, less chance to make a mistake, easier to read => use the first option.
That's sort of like asking if you should do this:
<%= DateTime.Now %>
or this
<% Response.Write(DateTime.Now) %>
There's no right answer, but one certainly looks better to me.