0

我想将 System.Web.HttpUtility.HtmlDecode 与 WebGrid 一起使用,但它不起作用我的代码是:

grid.GetHtml(tableStyle: "webGrid",
             htmlAttributes: new { id = "DataTable" },
             headerStyle: "header",
             alternatingRowStyle: "alt",
             columns: grid.Columns(
                 grid.Column("ArtId"),
                 grid.Column(columnName: "ArtDescription",
                                         format: item => System.Web.HttpUtility.HtmlDecode(item.ArtDescription))
             )
 ) 
4

1 回答 1

1

您应该使用Html.Raw

format: item => Html.Raw(item.ArtDescription)
于 2013-01-24T08:18:38.123 回答