title: ASP.Net MVC 3.0 Razor View Grid Ajax Pagination
body: <p>How can i implement Ajax for this Grid i have?</p>
  
  <pre><code>@{
  var grid = new WebGrid(source: Model, defaultSort: "FirstName", rowsPerPage: 5);
  }
  @if (Model.Count() &gt; 0)
  {
  &lt;div id="grid"&gt;
      @grid.GetHtml(
   tableStyle: "grid",
   headerStyle: "head",
   alternatingRowStyle: "alt",
   columns: grid.Columns(
   grid.Column("FirstName", "First Name"),
   grid.Column("LastName", "Last Name"),
   grid.Column("Address"),
   grid.Column("DOB"),
   grid.Column("Gender")
   )
      )
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>I tried adding ajaxUpdateContainerId but it is giving some error.
  I couldn't understand it.</p>
  
  <p>I have created my grid like below <br /></p>
  
  <pre><code>var grid = new WebGrid(canPage: true, rowsPerPage: 2, defaultSort: "FirstName", canSort: true, ajaxUpdateContainerId: "grid");
  grid.Bind(Model, rowCount:Model.Count(), autoSortAndPage: false);
  grid.Pager(WebGridPagerModes.All);
  </code></pre>
  
  <p>But it showing all the records in the grid where i want to show only 5 records in grid then paging</p>