title: Simple Custom Pager in MVC 3
body: <p>I am looking for the best way to implement a pager as per the following simple requirement.</p>
  
  <p>I want a page like this</p>
  
  <pre><code> &lt;Pager 1 2 3 4 ...&gt;
  
   &lt;Partial View&gt;
  </code></pre>
  
  <p>My action controller will look something like this...</p>
  
  <pre><code>    public PartialViewResult DisplayRecordDetails(int recordNumber)
      {
          MyRecord mr = GetRecord(recordNumber);
          return PartialView(mr);
      }
  </code></pre>
  
  <p>When I click on "1" (page index = 1), I pass 1 as a parameter to the DisplayRecordDetails action method and load the partial view with record 1.</p>
  
  <p>When I click on "2" (page index = 2), I pass 2 as a parameter to the DisplayRecordDetails  action method and load the partial view with record 2 and so on...</p>
  
  <p>I will have the total item count info and current page index info at my disposal. Now how can I generate the pager dynamically with this info?</p>
  
  <p>I have tried searching for pager libraries/helpers but all of them are for grids. How can I use them for my situation? I do not have a grid. I just have a partial view which I need to load dynamically depending on the page number.</p>