title: How does the InsertionMode.Replace works on the Ajax.BeginForm
body: <p>i have the following <code>Ajax.beginform</code> inside my asp.net mvc view, where the result of the ajax call will replace the  <code>&lt;div id= "searcharea"&gt;</code>, as follow:-</p>
  
  <pre><code>@using (Ajax.BeginForm("Search", "Patient",
      new AjaxOptions
  {
      HttpMethod = "GET",
      InsertionMode = InsertionMode.Replace,
      UpdateTargetId = "searcharea",
      LoadingElementId = "progress2"
  }))
  {
     &lt;table &gt;
  
   &lt;tr&gt;
  
          &lt;th&gt;
           Searching By First Name (English) :-
          &lt;/th&gt;
          &lt;th&gt;
            &lt;input type="text" name="firstname"  /&gt;
          &lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
  
          &lt;th&gt;
           Searching By Family Name (English) :-
          &lt;/th&gt;
          &lt;th&gt;
            &lt;input type="text" name="familyname"  /&gt;
          &lt;/th&gt;&lt;/tr&gt;
  
        &lt;input type="submit" value="Search      " /&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;
    &lt;/table&gt;
  
  }
  
  &lt;div id = "progress2"&gt;
  &lt;img src= "@Url.Content("~/Content/images/Ajax-loader-bar.gif") "&gt;
  &lt;/div&gt;
  &lt;p&gt;
  &lt;div id= "searcharea"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So at the begining i though that i will only be able to perform one search since the <code>&lt;div id= "searcharea"&gt;</code> will be replaced with the result of the ajax call and it will not be avilalbe after that, and if i try to do anther ajax call there will be no more <code>&lt;div id= "searcharea"&gt;</code> to replace the result with. </p>
  
  <p>But what actually happened is that I was able to do multiple searches without any problem ,, so does this means that the <code>InsertionMode.Replace</code> will not replace the DOM element and that it will only insert the result of the ajax call within this DOM,, <strong>because i can not understand how i can reference a DOM element multiple times even if it has been replaced by my first ajax call</strong> ???!! can anyone explain how this happen ?
  BR</p>