What is the most preferred and easiest way to do pagination in ASP.NET MVC? I.e. what is the easiest way to break up a list into several browsable pages.
As an example lets say I get a list of elements from a database/gateway/repository like this:
public ActionResult ListMyItems()
{
List<Item> list = ItemDB.GetListOfItems();
ViewData["ItemList"] = list;
return View();
}
For simplicity's sake I'd like to specify just a page number for my action as parameter. Like this:
public ActionResult ListMyItems(int page)
{
//...
}