title: How to call partial view using JQUERY
body: <p>I try to loadn partial view using ajax. But it gives me error as <code>Internal char error</code>.
  I debug the code then it call the action as well as also able to debug the the partial view but, after last line of partial view it gives me internal char error.</p>
  
  <p>below is the partial view:</p>
  
  <pre><code>@model company.learn.data.Models.ProductViewModel
  &lt;div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Action code is as follow:</p>
  
  <pre><code>  public ActionResult LoadProducts()
      {
          RepositoryProductManager m = new Repository.ProductManager();
          var p = m.RetrieveAllProducts();
          var l = p.Select(o =&gt; new ProductViewModel() { Cost = o.Cost, Description =    o.Description, Id = o.Id, ProductName = o.ProductName, ProductTypeName =   o.ProductType.Name, ProductTypeId = o.ProductTypeId }).ToList().FirstOrDefault();
          return PartialView("_LoadProducts",l);
       } 
  </code></pre>
  
  <p>jquery ajax call:</p>
  
  <pre><code>@section scripts
  {
  &lt;script&gt;
      $.getJSON('@Url.Action("LoadProducts","ProductManagement")', null, function (data)          {
          alert('f');
          //$('#ProductsDiv').html(data);
          alert('f');
      }
      ).error(function (e1, e2, e3) { alert(e3); });  //every time goes to alert this error.
  
     &lt;/script&gt;
  
  }
  </code></pre>
  
  <p>When i remove the DIV element from partial view and only keep first line (model binding)
  then it did not give me error but, whenevery i add any element into this view then it gives me error.</p>
  
  <p>Please guide me for weird behavior.</p>
  
  <p>thanks </p>