【发布时间】:2014-02-28 07:41:34
【问题描述】:
我有一个从数据库读取的字符串,其中包含我要输出的 HTML。尽管应用了HttpUtility.HtmlDecode(),视图总是将字符串呈现为编码的HTML(即&lt;SPAN&gt;而不是<SPAN>)。
我正在使用:
string test = WebUtility.HtmlDecode(myStr);
<span>@test</span>
我试过了:
string test = HttpUtility.HtmlDecode(myStr);
<span>@test</span>
<span>@HttpUtility.HtmlDecode(myStr)</span>
【问题讨论】:
标签: html asp.net asp.net-mvc asp.net-mvc-4