Use nuget to download and install package :
PM> Install-Package Codehaks.Pagination -Version 1.0.0
This is a very simple easy to use pagination Tag Helper for ASP.NET Core.
- ASP.NET Core 1.0,1.1,2.0,2.1,2.2 or higher
- Bootstrap 4.0
install using nuget :
PM > Install-Package Codehaks.Pagination -Version 1.0.0
also you need to reference Codehaks.TagHelpers in you view or _viewImports.cshtml
@addTagHelper *, Codehaks.Pagination
you can download sample project to see it in action: Demo project
on your view (razor page or MVC) add tag:
<Pagination page-count="@Model.TotalPages" page-target="/index" page-number="@Model.PageNumber" page-range="10"></Pagination>
- page-count is the number of pages in your list which should be provided from your server-side code.
- page-target is the path to send/get next page.
- page-range is the range of pagination buttons to be generated.
- page-first to rename the title of "First" button to other languages like "اول"
- page-last to rename the title of "Last" button to other languages like "آخر"
please report any bugs or issues you encounter.