OtherAct on OtherContController ... is it decorated [AcceptVerbs (HttpVerbs.Post)]?
If so, that is the first of your problems. Your action returning JavaScriptResult will work. But if the action is decorated with HttpVerbs.Post, then there is no Get action for this, and the Ajax call gets 404 not found . Of course, since this happens asynchronously, you would not know this. Error messages will not be displayed.
The second problem is simpler. You said...
return JavaScript("Window.location.href='OtherCont/OtherAct';")
... when you meant ...
return JavaScript("Window.location.href='OtherCont/OtherAct';")
... or more correctly ...
return JavaScript("window.location.href='" + Url.Action("OtherAct", "OtherCont") + "';");
It must be there.
source share