MVC Razor 输出没有编码的HTML字符串
public class DemoModel
{
public static string Content()
{
return "<p>aaaaaa</p>";
}
}
<h3>
@MvcApplication1.Models.DemoModel.Content()
</h3>
<h3>@(new HtmlString(MvcApplication1.Models.DemoModel.Content()))</h3>
<h3>
@Html.Raw(MvcApplication1.Models.DemoModel.Content())
</h3>
<h3>
@MvcHtmlString.Create(MvcApplication1.Models.DemoModel.Content())
</h3>


浙公网安备 33010602011771号