Thursday, July 3, 2014

MVC razor decode / encode HTML

Razor has the ability to automatically encoded html.
In order to avoid encoding use the HTML helper: @Html.Raw(text).



@{ var br = "
";} This is the line number 1 @Html.Raw(br) This is the line number 2 @Html.Raw(br) This is the line number 3 @Html.Raw(br)