问题描述
PagedList.Mvc工作正常,如果我不使用部分页面,但是当我用AJAX部分页面加载电网再有就是pagination.and问题,我从TroyGoode https://github.com/TroyGoode/PagedList/issues/26#issuecomment-6471793,但所提供的支持链接无法正常工作。
现在,我已经用这样的
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 }))
,它加载的页面,但我需要改变ajaxically分页。我怎样才能做到这一点?
, which loads the page but I need to change the pagination ajaxically. How can I achieve this?
推荐答案
此问题是由使用PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing解决。
This issue is solved by using PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing.
@Html.PagedListPager(Model.MovieInforamtions, page => Url.Action("GetMovieDatabase", page }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing( new AjaxOptions(){ HttpMethod = "GET", UpdateTargetId = "movie_grid"}))
这篇关于阿贾克斯在分页使用PagedList.MVC部分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!