Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax Pagination in PagedList.MVC using partial Page

Tags:

PagedList.Mvc is working fine if I do not use partial page but when I use partial page with ajax to load the grid then there is problem in pagination.and I ended with the support from TroyGoode https://github.com/TroyGoode/PagedList/issues/26#issuecomment-6471793, But link provided for the support is not working. Right now, I have used like this

@Html.PagedListPager((IPagedList)Model.MovieInforamtions, page => Url.Action("GetMovieDatabase", new { page })) 

, which loads the page but I need to change the pagination ajaxically. How can I achieve this?

like image 823
Yogendra Paudyal Avatar asked Jun 27 '13 06:06

Yogendra Paudyal


1 Answers

This issue is solved by using PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing.

@Html.PagedListPager(     Model.MovieInforamtions,      page => Url.Action("GetMovieDatabase", new { page = page}),     PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions(){  HttpMethod = "GET", UpdateTargetId = "movie_grid"}) ) 
like image 88
Yogendra Paudyal Avatar answered Nov 09 '22 22:11

Yogendra Paudyal