How to stop coding strings in ASP.NET MVC 3 beta 1?

How to stop coding strings in ASP.NET MVC 3 beta 1?

+3
source share
1 answer

I assume you mean HTML encoding?

in the comments of this post, it says you can use the Html.Raw helper method

http://weblogs.asp.net/scottgu/archive/2010/12/16/asp-net-mvc-3-implicit-and-explicit-code-nuggets-with-razor.aspx

an example from this post (Razor view, guessing for other viewing mechanisms?)

@{
    string content = "<b>Hello World</b>";
}

This is some html: @Html.Raw(content)

another good post about the Raw method

http://davidhayden.com/blog/dave/archive/2010/12/27/HtmlRawRazorViewEngine.aspx

+6
source

Source: https://habr.com/ru/post/1782942/


All Articles