Getting Started
26 Apr 20181 minute to read
This section briefly explains about how to create a Pager control in your application with ASP.NET MVC.
Adding scroller control in your MVC application
26 Apr 20181 minute to read
- Create an MVC Project and add required assemblies, scripts and styles to it referring MVC-Getting-Started Documentation.
- The Essential ASP.NET MVC Pager control based on total records count, page size and page count values. Add the following code example to the corresponding view pages to render the Pager control in your MVC application.
TotalRecordsCount: totalRecordsCount defines the total number of records which is bounded as a single data.
@Html.EJ().Pager("pager").TotalRecordsCount(20)
Run the above sample to get the below output.
PageSize: pageSize value defines the number of records to be displayed per page. The default value for the pageSize API is 12.
NOTE
The page count value changes with change in the pageSize value.
@Html.EJ().Pager("pager").TotalRecordsCount(20).PageSize(1)
Run the above sample to get the below output.
PageCount: pageCount value defines the number of pages to be displayed in the pager control for navigation. The default value for pageCount is 10 and value will be updated based on totalRecordsCount and pageSize values.
@Html.EJ().Pager("pager").TotalRecordsCount(20).PageSize(1).PageCount(3)
Run the above sample to get the below output.