Reputation: 142
I'm having problems with X.PagedList package. I'm using.net core mvc 2.2 for the project. Whatever I do the PagedListPager doesn't seem to work. It doesn't increment the page number and can't change the controller or action in it.
This is the controller
public IActionResult CategoryPairing(int? page = 1, int? pageSize = 25)
{
TrendyolCategoryPairVM trendyolCategoryPairVM = new TrendyolCategoryPairVM()
{
Categories = _categoryService.GetCategoriesAsIQueryable().ToPagedList((int)page, (int)pageSize),
TrendyolCategories = _trendyolCategoryService.GetAllCategories().Categories.Map(p => true, (NodeDTO n) => { return n.SubCategories; }).ToList()
};
return View(trendyolCategoryPairVM);
}
And the pager
@Html.PagedListPager((IPagedList)Model.Categories, page => Url.Action("Whatever","controller", new { page = page }),
new X.PagedList.Mvc.Core.Common.PagedListRenderOptions
{
DisplayItemSliceAndTotal = true,
ContainerDivClasses = new[] { "navigation" },
LiElementClasses = new[] { "page-item" },
PageClasses = new[] { "page-link" },
});
This one should route to the controller/whatever with the page number specified, but it just routes to the same page without a page number.
Upvotes: 1
Views: 468
Reputation: 142
I find out that X.PagedLists pager has some problems when it comes to .net core 2.2. Related issues can be found in here and here .
Upvotes: 1