title: ASP.NET MVC Partial view ajax post?
body: <p><strong>Index.html (View)</strong></p>
  
  <pre><code>&lt;div class="categories_content_container"&gt;
      @Html.Action("_AddCategory", "Categories")
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>_AddCategory.cshtml (PartialView)</strong></p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $('input[type=submit]').click(function (e) {
              e.preventDefault();
              $.ajax({
                  type: "POST",
                  url: '@Url.Action("_AddCategory", "Categories")',
                  dataType: "json",
                  data: $('form').serialize(),
                  success: function (result) {
                      $(".categories_content_container").html(result);
                  },
                  error: function () {
  
                  }
              });
          });
      });
  &lt;/script&gt;
  
  @using (Html.BeginForm())
  {
      // form elements
  }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>[HttpPost]
  public ActionResult _AddCategory(CategoriesViewModel viewModel)
  {
      if(//success)
      {
          // DbOperations...
          return RedirectToAction("Categories");
      }
      else
      {
          // model state is not valid...
          return PartialView(viewModel);
      }
  }
  </code></pre>
  
  <p>Question: If operation is success I expect that redirect to another page (Categories). But no action, no error message. If operation is not success, it is working like my expected.</p>
  
  <p>How can I do this? How can I route another page with using AJAX post?</p>