HTML Encoding Strings - ASP.NET Web Forms VS Razor View Engine

删除回忆录丶 提交于 2019-12-01 15:35:20

I guess the best approach would be to use the Raw extension-method: @Html.Raw(Model.Something)

@Model.Something automatically HTML encodes. If you want to avoid HTML encoding (and you want this only if you are absolutely sure what you are doing) you could use @MvcHtmlString.Create(Model.Something) (basically everything that implements IHtmlString won't be encoded). Phil Haack blogged about the Razor view engine syntax.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!