I have an ASP.Net MVC 3 application that uses a jQuery .ajax call to POST to a server-side controller action as follows
Client-Side jQuery call:
//Page the server
$.ajax({
url: '/Home/Call_Abort',
type: 'POST',
data: "{ 'op_id': '" + ajaxOPID + "', 'statMsg': '" + ajaxStatMsg + "'}",
contentType: 'application/json; charset=utf-8',
success: function (data) {
window.location.href = data.redirectUrl;
},
error: function (xhr, ajaxOptions, thrownError) {
alert("Error while paging the server to abort. Reported error: '" + xhr.responseText + "'.");
}
});
Server-controller action:
[HttpPost]
public JsonResult Call_Abort(string op_id, string statMsg)
{
return Json(new
{
redirectUrl = Url.Action("Operator_Home", "Home", new { op_id = op_id, status = statMsg }),
isRedirect = true
});
}
The return URL is supposed to redirect the user to a different View (i.e. the Operator_Home View). This works on my local development PC, routing to the Operator_Home View as expected, but when I run it on my Development Web Server (Server 2008 with IIS 7) to test, I get the following 404 error page thrown as the xhr.responseText result in the .ajax call above.

It seems like what’s happening is instead of redirecting to the View I specify in the redirectURL (i.e. Operator_Home), it seems to think the Call_Abort controller action is supposed to return a Call_Abort View, since no such View exists the error below gets tossed. But why would this happen on the Web Server and not on my local PC running the Visual Studio dev server? Is there some setting I need to make adjust for my application on IIS in order to get it to behave as it does on my development machine. My understanding of MVC routing isn’t clear enough to know why this is occurring. Any help or insight is appreciated.
UPDATE
My apologies, there are several servers I’m working with at my place of employemnt, I was referencing the wrong web server. The server I’m running this on is Server 2008 with IIS7

The error turned out to be an issue with the URL in tha .Ajax call I modified the URL as follows:
This resolved the issue and allowed jQuery to complete the POST.