我试图解码我在MVC 3 Razor应用程序中的数据库中的html文本.数据库中的html文本未编码.我尝试httpUtility.decode,server.decode,但没有一个工作.最后我设法使它成功Html.raw(string)
非工作代码的样本
@Server.HtmlDecode(item.ShortDescription)
@HttpUtility.HtmlDecode(item.ShortDescription)
Run Code Online (Sandbox Code Playgroud)
你知道为什么我不能在我的情况下使用html.decode!
我认为这样可以节省一些人从寻找几个小时.