Pagination

Pagination is used to divide content, usually lists, into separate pages. For example, when scaffolding a List view, the default scaffolding template generates a table that contains a row for each item in the collection you pass into the view. This is fine for small amounts of data, but if the list contains hundreds of items, your page will take a very long time to load. Ideally, you would like to split your list view into a manageable 5 to 10 items per page view.

In the first edition of this book we used the PagedList.Mvc NuGet package to make paging using Bootstrap 3 easier. This package is no longer maintained, but there is a drop-in replacement library available on NuGet called X.PagedList.

Unfortunately, neither NuGet Packages would ...

Get Bootstrap for ASP.NET MVC - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.