title: How to get an ASP.NET MVC Ajax response to redirect to new page instead of inserting view into UpdateTargetId?
body: <p>I am using the Ajax.BeginForm to create a form the will do an ajax postback to a certain controller action and then if the action is successful, the user should get redirected to another page (if the action fails then a status message gets displayed using the AjaxOptions UpdateTargetId).</p>
  
  <pre><code>using (Ajax.BeginForm("Delete", null,
          new { userId = Model.UserId },
          new AjaxOptions { UpdateTargetId = "UserForm", LoadingElementId = "DeletingDiv" },
          new { name = "DeleteForm", id = "DeleteForm" }))
     {
      [HTML DELETE BUTTON]
     }
  </code></pre>
  
  <p>If the delete is successful I am returning a Redirect result:</p>
  
  <pre><code>[Authorize]
  public ActionResult Delete(Int32 UserId)
  {
      UserRepository.DeleteUser(UserId);
      return Redirect(Url.Action("Index", "Home"));
  }
  </code></pre>
  
  <p>But the Home Controller Index view is getting loaded into the UpdateTargetId and therefore I end up with a page within a page.  Two things I am thinking about:</p>
  
  <ol>
  <li>Either I am architecting this
  wrong and should handle this type of
  action differently (not using ajax).</li>
  <li>Instead of returning a Redirect
  result, return a view which has
  javascript in it that does the
  redirect on the client side.</li>
  </ol>
  
  <p>Does anyone have comments on #1?  Or if #2 is a good solution, what would the "redirect javascript view" look like?</p>