2013-01-23 55 views
0

我想用System.Web.HttpUtility.HtmlDecode用的WebGrid,但它不工作 我的代碼是:ASP.NET MVC 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)) 
      ) 
) 

回答

1

你應該使用Html.Raw

format: item => Html.Raw(item.ArtDescription)