title: Populating table in a partial view
body: <p>I have two model classes,</p>
  
  <pre><code>public class Claims //Goes into main view
  {
      public int Id { get; set; }
      public string ClaimName { get; set; }
      public List&lt;ClaimDetails&gt; ClaimList { get; set; }
  }
  
  public class ClaimDetails //Class I want in my partial view
  {
      public int ClaimNumber { get; set; }
      public string Client { get; set; }
      public int Amount { get; set; }
      public string Type { get; set; }
  }
  </code></pre>
  
  <p>My controller,</p>
  
  <pre><code>public class ClaimsController : Controller
  {
      public ActionResult Index()
      {
          Claims claims = new Claims();
          claims.Id = 1;
          claims.ClaimName = "Ashton";
          return View(claims);
      }
      [HttpPost]
      public ActionResult SearchList(string enterdNumber)//On click of button I come here using ajax call
      {
          ClaimDetails cD = new ClaimDetails();
          Claims cms = new Claims();
          cms.ClaimList = new List&lt;ClaimDetails&gt;();
          cD.ClaimNumber = 10;
          cD.Client = "Ashton";
          cD.Amount = 2900;
          cD.Type = "Vendor";
          cms.ClaimList.Add(cD);
          ClaimDetails cDD = new ClaimDetails();
          cDD.ClaimNumber = 10;
          cDD.Client = "Ashton";
          cDD.Amount = 2900;
          cDD.Type = "Vendor";
          cms.ClaimList.Add(cDD);
  
          return PartialView("SearchList",cms);
      }
  </code></pre>
  
  <p>My main view in which I want my partial view to be rendered,</p>
  
  <pre><code>@using BusinessLayer
  @model BusinessLayer.Claims
  @{
      ViewBag.Title = "Index";
  }
  &lt;script src="~/Scripts/jquery-1.10.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
          @Html.LabelFor(m =&gt; m.Id):@Model.Id
      &lt;/div&gt;
      &lt;div class="col-md-6"&gt;
          @Html.LabelFor(m =&gt; m.ClaimName):@Model.ClaimName
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
          &lt;input id="searchNumber" placeholder="Enter the number" type="text" /&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
          &lt;button id="searchBtn" type="button"&gt;Search&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-md-12"&gt;
          @Html.Partial("SearchList",Model.ClaimList)
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#searchBtn").on("click", function () {
              var enteredNum = $("#searchNumber").val();
              $.ajax({
                  type: "POST",
                  url: "/Claims/SearchList",
                  data: { enterdNumber: enteredNum }
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My partial view, </p>
  
  <pre><code>@model BusinessLayer.Claims
  &lt;p&gt;
      @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table class="table"&gt;
      &lt;tr&gt;
          &lt;th&gt;Claim Number&lt;/th&gt;
          &lt;th&gt;Client&lt;/th&gt;
          &lt;th&gt;Amount&lt;/th&gt;
          &lt;th&gt;Type&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tbody&gt;
          @if (Model.ClaimList != null)
          {
              foreach(var item in Model.ClaimList)
              {
                  &lt;tr&gt;
                      &lt;td&gt;@item.ClaimNumber&lt;/td&gt;
                      &lt;td&gt;@item.Client&lt;/td&gt;
                      &lt;td&gt;@item.Amount&lt;/td&gt;
                      &lt;td&gt;@item.Type&lt;/td&gt;
                  &lt;/tr&gt;
              }
          }
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>My control comes to my partial view page, which I confirmed using breakpoint, it also iterates through the foreach loop but still does not put rows into my table..Help to know where I am going wrong is appreciated, or may be my approach to partial view is itself wrong?</p>