Window not redirected to correct URL passed from Json return
function GetOpenUrl(transactionId, legacyIndication)
{
var json = {
id : transactionId,
legacyIndication : legacyIndication
};
$.ajax({
type: "POST",
url: "<%= Url.Action("OpenSavedIndication", "Indications") %>",
data: json,
success: function(data) {
alert(data);
//window.location = data;
}
});
}
So when I perform that alert, I get the correct URL:
"/Extranet/mvc/Indications.cfc/Economics/02559e2e-d48e-4623-b877-69f36aa8b011"
However, if I let it run, I get an error page that says:
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Extranet/mvc/Indications.cfc开发者_StackOverflow中文版/"/Extranet/mvc/Indications.cfc/Economics/02559e2e-d48e-4623-b877-69f36aa8b011"/Extranet/mvc/Indications.cfc/"/Extranet/mvc/Indications.cfc/Economics/02559e2e-d48e-4623-b877-69f36aa8b011"
what is happening?
Edit:
Controller action return code:
return Json(Url.Action("Economics", new { id = indicationBase.ID }));
I changed the controller action to just return the Id, and now I redirect like this:
var idData = JSON.parse(data);
window.location = "Economics/" + idData.id;
Seems to work fine.
精彩评论