Currently, I'm using a strategy found on many blog posts. Basically, the URL contains the page number (e.g. /Users/List/5 will give you the users on page 5 of your paged list of users). However, I'm not running into a situation where one page must list two separate paged lists. How do I go about doing this using ASP.NET MVC? Do I simply provide two url parameters (e.g. /Users/List?page1=1&page2=2)? Is there a better way by using partial views?
Asp.net-mvc – How to implement paging in ASP.NET MVC
asp.net-mvcpaging
Related Topic
- C# – How to create a dropdownlist from an enum in ASP.NET MVC
- C# – How to handle multiple submit buttons in ASP.NET MVC Framework
- Asp.net-mvc – How to render an ASP.NET MVC view as a string
- Asp.net-mvc – How to get ELMAH to work with ASP.NET MVC [HandleError] attribute
- Asp.net-mvc – ASP.NET MVC – Set custom IIdentity or IPrincipal
- Asp.net-mvc – How to get all Errors from ASP.Net MVC modelState
- C# – File Upload ASP.NET MVC 3.0
Best Answer
Ignoring routes for just a minute, you'll just keep the state of the 2 different pages in the URL as querystring parameters.
mysite.com/foo?list1page=2&list2page=8
Then you build the data/pagers accordingly. The pager links will just update the url.
You can get creative with routes to create more friendly URLs, but I think querystring params are perfectly acceptable here.