Losing context from JQuery post with ASP.Net MVC
- by Dan
I have a JQuery dialog box on a page that calls something like this:
$.post("/MyController/MyAction", { myKey: key} //...
And this successfully gets here:
[HttpPost]
public ActionResult MyAction(int myKey)
{
//do some stuff
return RedirectToAction("AnotherAction");
}
The problem is that the RedirectToAction has no effect on the webbrowser. I am guessing this is because the JQuery post is kinda on a different 'tread' so it doesn't know where to send the response? How do I get the browser to load the new response?