在MVC剃刀局部视图分页的webGrid.GetHtml剃刀、分页、视图、局部

2023-09-10 19:56:55 作者:那一夜的温柔

我有我的网页...对于第一个标签两个标签,我加载在页面加载的网格;第二,对点击,我使用 Ajax.ActionLink 加载使用部分视图电网。

I have two tabs on my page... For the first tab, I am loading the grid on page load; for the second, on click, I am using Ajax.ActionLink to load the grid using a partial View.

我使用 webGrid.GetHtml()渲染网格在这两个选项卡默认分页。分页第一个选项卡是工作非常顺利。但对于第二个选项卡下的电网,如果我点击页面上的数目,将与选择的第二页新窗口中打开整个局部视图。

I am using webGrid.GetHtml() to render the grid with default pagination in both the tabs. The pagination for the First tab is working very smoothly. But for the grid under the second Tab, if I click on the page number, it will open the entire partial View in a new window with the second page selected.

任何建议/解决方案将是非常美联社preciated。

Any suggestion/solution will be highly appreciated.

推荐答案

我搜索整个网络,但忘了加属性ajaxUpdateContainerId的的WebGrid方法。它的工作就像一个魅力。该网页是不是清爽分页是工作非常顺利。 该ajaxUpdateContainerId用于更新与刷新数据的一些标签内容;提供电网应该使用Ajax调用加载。所以我用一个div标签,在我的grid.gethtml,给div标签的ID在ajaxUpdateContainerId属性。

I searched the whole net but forget to add the attribute ajaxUpdateContainerId for the WebGrid method. It worked like a charm. The page is not refreshing and the pagination is working very smoothly. The ajaxUpdateContainerId is used to update some tag contents with the refreshed data; provided grid should be loaded using ajax call. So I used a div tag around my grid.gethtml and gave the id of div tag in ajaxUpdateContainerId attribute.

任何其他解决办法也是可以接受的...... !!!!!

Any other solution will also be accepted....!!!!!

有关更多信息 http://galratner.com/blogs/net/archive/2011/12/02/reloading-a-razor-webgrid-after-ajax-calls-using-a-partial-view.aspx