I'm displaying dynamically selected columns as a grid(using webgrid) in partial view.When i perform paging on partial view webgrid,that partial view grid alone loading again in new page.I want to get the pagination for partial view without redirecting partialview alone into newpage.
Asked
Active
Viewed 3,605 times
0
-
Can you provide a snippet of your code please? Given that I have not seen your code yet, I think you might be able to reach your goal using methods of @@Ajax helper instead of @@Html – Bahador Izadpanah Jul 03 '13 at 12:01
-
@{ var grid1 = new WebGrid(Model.oTravelReadyEntities, canPage: true, rowsPerPage: 3,ajaxUpdateContainerId:"result"); grid1.Pager(WebGridPagerModes.NextPrevious); @grid1.GetHtml(tableStyle: "WebGrid", headerStyle: "Header", alternatingRowStyle: "alt", columns: ViewBag.Columns) } – user2514925 Jul 03 '13 at 12:22
1 Answers
0
Judging from the code you provided it seems that you are setting the ajaxUpdateContainerId to "result" but there is not any control with that id on your page you can set the id in .GetHtml() method by providing HtmlAttributes.
So the edited line would look something like this:
@grid1.GetHtml(htmlAttributes: new { id="result" },tableStyle: "WebGrid", headerStyle: "Header", alternatingRowStyle: "alt", columns: ViewBag.Columns)
Please check this link for more details

Community
- 1
- 1

Bahador Izadpanah
- 1,866
- 1
- 14
- 13