Thursday, August 15, 2013

ASP.NET Razor: Output String Without Encoding

If you are using the ASP.NET Razor view engine and have to output a string without encoding, you have to replace the @variable_name with an @Html.Raw(variable_name). Sure, it seems like additional effort to do it in the Razor view engine when compared to the <%: and %> in ASP.NET ASPX view engine but it is an edge case that you would barely encounter 20% of the time when building applications with ASP.NET.

No comments: