It seems like the PagedList.Core
does not contain the extension method for Html helper, so I cannot use the code below:
@Html.PagedListPager(Model, page => Url.Action("Index", new { page }), PagedListRenderOptions.MinimalWithItemCountText)
I was able to successfully implement the paging in previous version of MVC, but it does not work in ASP.Net Core. Below I have attached IL Dasm reference. Am I missing something, or is there any other way to implement that?
PagedList.Mvc:
PagedList.Core.Mvc:
I should follow the Instructions of the new version, it is a little different from previous version. I was able to implement the paging with the following code changes:
Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
}
_ViewImports.cshtml:
@addTagHelper *, PagedList.Core.Mvc
And finally to use it, we don't use Html tag helper anymore in .Net Core:
<pager class="pager-container" list="@Model" options="@PagedListRenderOptions.TwitterBootstrapPager" asp-action="Index" asp-controller="ControllerName" />