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.
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.
Any suggestion/solution will be highly appreciated.
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....!!!!!
for additional Info
http://galratner.com/blogs/net/archive/2011/12/02/reloading-a-razor-webgrid-after-ajax-calls-using-a-partial-view.aspx