Controller.cs
ViewData["Applications"] = await _applicationClient.GetAll();
view.cshtml
@(Html.Kendo().Grid<ResourceViewModel>
()
.Columns(columns =>
{columns.ForeignKey(r => r.ApplicationId, (System.Collections.IEnumerable)ViewData["Applications"], "Id", "Assembly").Title("Application").Width(100);})
ForeignKey列的antixss代码是什么?
答案 0 :(得分:1)
保存到数据库时,使用HttpUtility.HtmlEncode(..)解决了类似的问题。
HttpUtility.HtmlEncode(application);