title: Webgrid ajax call MVC 5
body: <p>The goal:</p>
  
  <p>To populate the webgrid when selecting the next page via ajax (I do not want the page to reload).</p>
  
  <p>Currently I have :</p>
  
  <pre><code>public ActionResult Index()
  {
      var users = (from a in _context.Audit
                   select new
                   {
                       a.AuditId,
                       a.FirstInserted,
                       a.FirstInsertedBy,
                       a.IsDeleted
                   }).ToList();
      return View(users);
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>@{ 
      var grid = new WebGrid(Model, rowsPerPage: 10, ajaxUpdateContainerId: "grid");
  }
  &lt;div id="grid"&gt;
  @grid.GetHtml(tableStyle: "table table-bordered", mode: WebGridPagerModes.All,
      firstText: "&lt;&lt; First",
      previousText: "&lt; Prev",
      nextText: "Next &gt;",
      lastText: "Last &gt;&gt;")
  &lt;/div&gt;
  </code></pre>
  
  <p>The problem:</p>
  
  <p>The webgrid shows up but it seems to only do a get call on the index action. How can I change this so that it will preform an ajax call to a method supplying the model?</p>
  
  <p>I have looked here and it did not give me too much of a hint to accomplish this: <a href="https://msdn.microsoft.com/en-us/magazine/hh288075.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/magazine/hh288075.aspx</a></p>