Reputation: 904
I am trying to add pagination to a page with Html.Pager of the MvcPaging, the problem is that the url generated contains the page number in a value named page.
So I got something like this /orders?page=1
I want it to be like this /orders?pageIndex=1
here is my code
@Html.Pager(Model.PageSize, Model.CurrentPage, Model.TotalPage * Model.PageSize).Options(o => o.DisplayTemplate("_paginationFooter"));
Upvotes: 0
Views: 1091
Reputation:
Use the PageRouteValueKey
property of Options
to override the default value (which is "page")
@Html.Pager(Model.PageSize, Model.CurrentPage, Model.TotalPage * Model.PageSize).Options(o => o
.PageRouteValueKey("pageIndex")
.DisplayTemplate("_paginationFooter")
)
For a complete list of all options (and the source code), refer MvcPaging.
Upvotes: 1