New Syntax for HTML Encoding Output in ASP.NET 4
Recently Scott Guthrie has been posting a series on new features to be found in asp.net 4.0.
One feature that really caught my eye was a new way to encode your html string output as html.
Currently if you want to encode your text to html you have to do something like the following:
But now, you can simply do this:
One feature that really caught my eye was a new way to encode your html string output as html.
Currently if you want to encode your text to html you have to do something like the following:
<div class="article"> <%= Server.HtmlEncode("some string with an & in it") %> </div>
<div class="article">
<%: "some string with an & in it" %> </div>
No comments:
Post a Comment