Ajax分页和排序在MVC4 WebGrid中不起作用
这是代码
@{ WebGrid grid = new WebGrid(rowsPerPage: Model.PageSize, canPage: true, canSort: true, ajaxUpdateContainerId: "Grid");
grid.Bind(Model.List, rowCount: Model.TotalRecordCount, autoSortAndPage: false); }
<div id="grid">
@grid.Table(
tableStyle: "table table-bordered table-hover",
columns: new[] {
grid.Column("Id"),
grid.Column("SampleText"),
grid.Column("Descreption")
})
</div>
@grid.PagerList(mode: WebGridPagerModes.All)
我正在使用jquery-2.1.0.min
请给我一些建议。 提前致谢
答案 0 :(得分:1)
您必须在代码之前包含jquery以生成网格。
<script src="@Url.Content("~/Scripts/jquery-2.1.0.js")"></script>