title: What is the right way to implement ajaxUpdateContainerId in webgrid?
body: <p>I had read some tutorials of how to implement a MVC webgrid through AJAX  but I want to understand what's happening under the hood, and which is the correct implementation for ajaxUpdateContainerId.</p>
  
  <p><strong>Example A:</strong></p>
  
  <pre><code>@{   
    var grid = new WebGrid(Model, rowsPerPage: 10, ajaxUpdateContainerId: "result");
  
    @grid.GetHtml(htmlAttributes: new {  id = "result" }, tableStyle: "webgrid",
    grid.Columns(
    grid.Column(columnName: "ID", header: "ID", canSort: true),
    grid.Column(columnName: "Name", header: "Name", canSort: true)))
  }
  </code></pre>
  
  <p><strong>Example B</strong></p>
  
  <pre><code> @{   
    var grid = new WebGrid(Model, rowsPerPage: 10, ajaxUpdateContainerId: "result");
  
   &lt;div id="result"&gt;
    @grid.GetHtml( tableStyle: "webgrid",
    grid.Columns(
    grid.Column(columnName: "ID", header: "ID", canSort: true),
    grid.Column(columnName: "Name", header: "Name", canSort: true)))
   &lt;/div&gt;
  }
  </code></pre>
  
  <p><strong>Example C:</strong></p>
  
  <pre><code>&lt;div id="result"&gt;
   @{   
    var grid = new WebGrid(Model, rowsPerPage: 10, ajaxUpdateContainerId: "result");
  
  
    @grid.GetHtml(tableStyle: "webgrid",
    grid.Columns(
    grid.Column(columnName: "ID", header: "ID", canSort: true),
    grid.Column(columnName: "Name", header: "Name", canSort: true)))
  
   }
  &lt;/div&gt;
  </code></pre>
  
  <p>I know that you have to bind the content to the grid and that you have to pass only the elements that you are going to display in the webgrid, but I'm trying to understand  how ajaxUpdateContainerId works, so this examples work for this purpose.</p>
  
  <p>Which of this examples is the correct way to update the content and why?</p>
  
  <p>ajaxUpdateContainerId is doing a "Update" or really is doing a Replace content?</p>
  
  <p>I hope someone can help me with this and this can be useful to someone else. Thanks In advance. </p>