This is the second part of a series of posts detailing how I built a pretty awesome ASP.NET MVC grid with support for sorting and paging. For details about the model that will be bound to the grid, check out: My Grid Pt. 1: A Better Paged Collection.
Here is the reference picture of what I want the pager to look like:
As you can see, it consists of three parts:
- Results information
- Page size selector
- Page selector
We’ll start with the page size selector. This will be a private method that takes in the current page size and an optional integer suffix to append to the query string keys (in order to support multiple grids on one page).