title: Partial view won't update after ajax.beginform
body: <p>I'm fairly new to mvc3, so bear with me please.</p>
  
  <p>This is the scenario:
  I have, inside my view, a small menu, and another partial view, which shows products whose names match the  input from the user.</p>
  
  <p><code>@model List&lt;BlokCWebwinkelGroep3.Models.Product&gt;</code></p>
  
  <p>In the mini menu I have a slider (with 2 slider handles) and a button 'search' (both are in a ajax.beginform). when I click on the search button the 2 values of the slider get sent as parameters to a HttpPost actionmethod "search" (these values are in the hidden input field, which is updated by some javascript when someone slides the slider), which returns a partialview(_myPartial, model). (the model is a list).</p>
  
  <p><strong>Ajax.BeginForm</strong></p>
  
  <pre><code>    @using (Ajax.BeginForm("Search",
                      new AjaxOptions
                      {
                          UpdateTargetId = "table-container",
                          InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
                          HttpMethod = "POST"
                      }))
  {   
      &lt;input type="hidden" name = "hidden" id="hidden_amount" /&gt;
      &lt;div id="slider-range"&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;button type="submit" value="Search"&gt;
          Search&lt;/button&gt;
  }
  </code></pre>
  
  <p><strong>Action Method</strong></p>
  
  <pre><code>    [HttpPost]
      public PartialViewResult Search(string hidden)
      {
          List&lt;Product&gt; Model = null;
          string[] values = hidden.Split(' ');
          int[] convertedString = Array.ConvertAll&lt;string, int&gt;(values, int.Parse);
          string name = (string)TempData["searched"];
          try
          {
              Model = ResultDBController.GetAdvancedSearched(name, convertedString[0], convertedString[1]);
          }
          catch (Exception e)
          {
              ViewBag.Foutmelding = "Er is iets foutgegaan: " + e;
          }
          return PartialView("_Product", Model);
      }
  </code></pre>
  
  <p>The UpdateTargetId is the div "table-container"</p>
  
  <pre><code>    @*Calls the _Product partial view*@
  &lt;div class="table-container"&gt;@Html.Partial("_Product", Model)&lt;/div&gt;
  </code></pre>
  
  <p>Then it runs through the partial view, however it does not show up on the screen..</p>
  
  <p><strong>Partial view</strong></p>
  
  <pre><code>    &lt;table class="productlist"&gt;
  @foreach (BlokCWebwinkelGroep3.Models.Product product in Model)
  { 
      &lt;tr class="product" onclick="location.href = '@(Url.Action("ProductPage", "Product", new {ProductID = @product.ProductID}))'"&gt;
  
          &lt;td&gt;
              &lt;img src = '@product.ImageURL' alt = '@product.Name' /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              @product.Name
          &lt;/td&gt;
          &lt;td&gt;
              €@product.Price
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p></p>
  
  <p>Say I search "er", that will display 3 products on screen. 2 are &lt; 75 euro the other one is 183 euro. If I set the slider to 75 - 300, I can debug and see that everything is alright. The partialview which gets returned in the actionmethod contains only the product which is 183 euro, then it loops through the partial view once, however the partial view does not update to that version, it stays on the same version with the 3 products.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>P.S.
  I use the following scripts in my header</p>
  
  <pre><code>        &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/css" src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
  </code></pre>