user2514925
user2514925

Reputation: 949

Pagination in Partial View

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.

Upvotes: 0

Views: 3624

Answers (1)

Bahador Izadpanah
Bahador Izadpanah

Reputation: 1866

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

Upvotes: 0

Related Questions