title: How to update partial data without loading the html in MVC
body: <p>I want to upload partial view data without reloading the html. i have used <code>Json</code> to get the data but I think there is some issues in Script. The <code>Success</code> part is not executing.</p>
  
  <pre><code>  [HttpPost]
          public JsonResult HorseTracker(ClsHorseTracker model)
          {
              try
              {
                  if (ModelState.IsValid)
                  {
  
                    horseTrackerDetails.InsertUpdateHorseTracker(model);
                      }
                                          }
                  return Json(model, JsonRequestBehavior.AllowGet);
              }
              catch
              {
                  return Json(new { success = false });
              }
          }
  
   [ChildActionOnly]
          public PartialViewResult HorseTrackerDetails()
          {
              return PartialView("_pHorseTrackerDetails", horseTrackerDetails.HorseTrackerList());
          }
  </code></pre>
  
  <p>Main View</p>
  
  <pre><code> @using (Html.BeginForm("HorseTracker", "HorseTracker", FormMethod.Post, new { id = "CreateForm" }))
          {
              &lt;div class="panel panel-default" style="font-size:12px;"&gt;
  
                  &lt;div class="panel-body"&gt;
                      &lt;div class="form-group"&gt;    
  
                          @Html.TextBoxFor(m =&gt; m.HorseName)
  
                          @Html.DropDownListFor(m =&gt; m.HorseTypeName, Model.HorseTypeList)
  
                      &lt;/div&gt;
                      &lt;input type="submit" value="Save" class="btn btn-primary pull-right" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
          }
  
      &lt;/div&gt;
      &lt;div id="partial" class="col-md-8"&gt;
          @Html.Action("HorseTrackerDetails", "HorseTracker")
      &lt;/div&gt;
  </code></pre>
  
  <p>Partial View</p>
  
  <pre><code>  &lt;table class="table"&gt;
                  &lt;tr&gt;
  
                      &lt;th&gt;
                          @Html.DisplayNameFor(model =&gt; model.HorseName)
                      &lt;/th&gt;
  
                      &lt;th&gt;
                          @Html.DisplayName("Type")
                      &lt;/th&gt;
  
  
                  &lt;/tr&gt;
  
                  @foreach (var item in Model)
                  {
                      &lt;tr&gt;
  
                          &lt;td&gt;
                              @item.HorseName
                          &lt;/td&gt;
  
                          &lt;td&gt;
                              @item.HorseTypeName
                          &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Script</p>
  
  <pre><code>  $(document).ready(function () {
              var url = '@Url.Action("HorseTracker", "HorseTracker")';
              $('#CreateForm').submit(function () {
  
                    if (!$(this).valid()) {
                      return;
                     }
                   $.post(url,$(this).serialize(), function (response) {
                       if (response.success) {
                           debugger;
                           $('#partial').html(response);
                       }
                       else {
                           var message = response.message;
                           alert(message);
                        }
                  });
                     return false;
                 })
          })
  </code></pre>