title: Pass the result of AJAX callback to Partial View using JQuery
body: <p>I'm using ASP.NET MVC 4. On a button click, I want to invoke ajax callback to controller method and return the data needed as Json Data. I'm able to do this using the following code:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function () {
      var ajax_url = '@Url.Action("GetNewItems")';
      $("#submit").click(function () {
          $.ajax({
              url: ajax_url,
              type: "POST",
              datatype: "json",
              success: function (data) {
                  debugger
              }
          });
      });
  });
  </code></pre>
  
  <p></p>
  
  <pre><code>[HttpPost]
      public JsonResult GetNewItems()
      {
          List&lt;Item&gt; items = new List&lt;Item&gt;();
  
          items.Add(new Item() { Id = 3, Name = "c" });
          items.Add(new Item() { Id = 4, Name = "d" });
  
          return Json(items);
      }
  </code></pre>
  
  <p>In success function, the collection of Items are returned properly. In this function, I want to call Html.Partial and pass the result as the model of the Partial view. Is this possible?</p>
  
  <p>I've searched in other threads, but most of them are suggesting that Partial View is returned from Controller method and html(data) is used to render it. I'd rather not return the Partial view from Controller, as the size would have significant difference rather than returning the data only and render it manually in client-side.</p>
  
  <p>So, is it possible to pass the result to Partial view in success function, or I have to manually render the elements in there? </p>
  
  <p>Any help is appreciated. Thanks!</p>