paginationuser-controlsasp.net-mvc-2

Paging more than one collection on a single page in asp.net mvc


I'm building a search engine for documents using asp.net mvc. The results of the search are two different IList collections (One for the people matched and one for the documents matched with the search parameters). I put these collections in a class and return the class to the view. The view uses HTML.RenderPartial() to bind the respective collection to its own user control. I want to page each of those collections independently. How do I create an action method to change the page of each individual collection without having to rebind the values for the other collection? (Both collections are displayed on the same page).


Solution

  • public ActionResult Search(int pagePeople, int pageDocuments)
    

    Alternatively, you can use the new Html.Action (take a look here). I don't exactly understand of what you have or what you want. Try giving me more info.