部分视图中的分页

时间:2013-07-03 11:52:13

标签: asp.net-mvc-3 jquery uiviewcontroller pagination razor-grid

我在局部视图中将动态选择的列显示为网格(使用webgrid)。当我在部分视图webgrid上执行分页时,仅在新页面中再次加载部分视图网格。我想获得部分视图的分页没有将partialview单独重定向到新页面。

1 个答案:

答案 0 :(得分:0)

从您提供的代码判断,您似乎将ajaxUpdateContainerId设置为“result”,但是您的页面上没有任何具有该ID的控件,您可以通过提供HtmlAttributes在.GetHtml()方法中设置id。

所以编辑过的行看起来像这样:

@grid1.GetHtml(htmlAttributes: new { id="result" },tableStyle: "WebGrid", headerStyle: "Header", alternatingRowStyle: "alt", columns: ViewBag.Columns)

请查看this link了解详情