title: why my <div> wont update?
body: <p>the application was originally intended to update "<code>div-list</code>" block in search and when passed valid product codes to search the <strong>LINQ</strong> returned a valid product but it did not load the partial page <code>_ProductCategoryList</code>. To test i have added <code>&lt;p&gt;updated&lt;/p&gt;</code> in to js function <code>loadtodiv()</code> but it did not display that message either.Why this partial page or this html message wont get displayed on that div?</p>
  
  <p>in my MVC4 razor app i have the an index page with the following razor syntax:</p>
  
  <pre><code>@using(Ajax.BeginForm("GetCategory", "Home",
  new AjaxOptions { 
      HttpMethod="GET", 
      UpdateTargetId="div-list",
      InsertionMode = InsertionMode.Replace,
      OnSuccess = "loadtodiv"
  }))
  {
      &lt;input type="text" class="form-control" name="Code" value="" style="width:500px;" /&gt;
      &lt;input type="Submit" class="btn btn-default" value="Search" id="search-btn"/&gt;
  }
  
  &lt;br /&gt;
  
  &lt;script type="text/javascript"&gt;
      function loadtodiv() {
          $('#div-list').html('&lt;p&gt;updated&lt;/p&gt;');
      }
  &lt;/script&gt;
  
  
  &lt;div class="jumbotron"&gt;
      &lt;h2&gt;Index&lt;/h2&gt;        
  
  
  &lt;/div&gt;
  &lt;div id="div-list"&gt;
  
  &lt;p&gt;this is empty&lt;/p&gt;    
  &lt;/div&gt;
  </code></pre>
  
  <p>the controller to the index page is : </p>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.Web.Mvc;
  
      namespace eComm1.Controllers
      {
          public class HomeController : Controller
          {
              TUDBEntities _db = new TUDBEntities();
  
              //
              // GET: /Home/
  
              public ActionResult Index()
              {
                  return View();
              }
  
              public ActionResult GetCategory(string Code)
              {
                  var categories = _db.mt_ProductCategories.Where(pc =&gt; pc.CatCode == Code).FirstOrDefault();
                  return PartialView("_ProductCategoryList", categories);
              }
      }
  }
  </code></pre>
  
  <p>and my partial view _ProductCategoryList.cshtml is : </p>
  
  <pre><code>@model IEnumerable&lt;eComm1.Models.ProductCategory&gt;
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.CategoryCode)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Name)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Url)
          &lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
      &lt;/tr&gt;
  
  @foreach (var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.CategoryCode)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Name)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Url)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
              @Html.ActionLink("Details", "Details", new { id=item.Id }) |
              @Html.ActionLink("Delete", "Delete", new { id=item.Id })
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  
  &lt;/table&gt;
  </code></pre>