【发布时间】:2019-07-29 06:55:46
【问题描述】:
在我的项目中,我尝试添加网格,但它显示以下错误 'HtmlHelper>' 不包含“网格”的定义和最佳扩展方法重载 “MvcGridExtensions.Grid(IHtmlHelper, IEnumerable)”需要“IHtmlHelper”类型的接收器
代码:
@model IEnumerable<SCM_MVC.Models.XXXXX>
@using NonFactors.Mvc.Grid;
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.select).Titled("Name");
columns.Add(model => model.Surname).Titled("Surname");
columns.Add(model => model.MaritalStatus).Titled("Marital status");
columns.Add(model => model.Age).Titled("Age");
columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
columns.Add(model => model.IsWorking).Titled("Employed");
})
.Empty("No data found")
.Filterable()
.Sortable()
.Pageable()
)
这里做错了什么?
【问题讨论】:
标签: asp.net-mvc-5 mvcgrid