This question already has an answer here:
- How can I RedirectToAction within $.ajax callback? 4 answers
The following does not redirect my page: Here is the MVC code:
[HttpPost]
public ActionResult GoHome()
{
return RedirectToAction("Index", "Home");
}
Here is the ajax post:
$.support.cors = true;
$.ajax({
type: "POST",
url: "http://localhost/UserAccount/GoHome",
dataType: 'json',
crossDomain: true
});
The post is successful and when it hists the GoHome action it does not redirect to the Index Action of the Home Controller.