Paging in ASP.NET MVC5

Pagination in MVC is a simple work. It is not necessary to use any third party extension for paging in MVC. In this Tutorial I've implemented paging in MVC step-by-step.

C# (19.9 MB)
 
 
 
 
 
(0)
550 times
Add to favorites
1/6/2017
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • There is a bug in the code
    2 Posts | Last post December 04, 2017
    • There is a bug in the code. 
      Simple test: use 3 records only and set the page size to 1.
      You should get 3 pages but intead only 2 pages are shown
    • In the partial view, go to the following line:
      double _pageCount = ((double)((Model.TotalCount-1) / Model.PageSize)); 
      
      replace with this line:
      double _pageCount = ((double)((Model.TotalCount + Model.PageSize - 1) / Model.PageSize));
      
      Now it works