title: How do I do pagination in ASP.NET MVC?
body: <p>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.</p>
  
  <p>As an example lets say I get a list of elements from a database/gateway/repository like this:</p>
  
  <pre><code>public ActionResult ListMyItems()
  {
      List&lt;Item&gt; list = ItemDB.GetListOfItems();
      ViewData["ItemList"] = list;
  
      return View();
  }
  </code></pre>
  
  <p>For simplicity's sake I'd like to specify just a page number for my action as parameter. Like this:</p>
  
  <pre><code>public ActionResult ListMyItems(int page)
  {
     //...
  }
  </code></pre>