窗口未重定向到从 Json 返回传递的正确 URL
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;
}
});
}
因此,当我执行该警报时,我会得到正确的 URL:
“/Extranet/mvc/Inspirations.cfc/Economics/02559e2e-d48e-4623-b877-69f36aa8b011”
但是,如果我让它运行,我会收到一个错误页面,其中显示:
描述:HTTP 404。资源 您正在寻找(或其之一 依赖项)可能已被删除, 已更名,或者是 暂时无法使用。请 检查以下 URL 并确保 拼写正确。
请求的网址: /Extranet/mvc/Inspirations.cfc/"/Extranet/mvc/Inductions.cfc/Economics/02559e2e-d48e-4623-b877-69f36aa8b011"/E xtranet/mvc/Inspirations.cfc/"/Extranet/mvc/Inductions.cfc/Economics/02559e2e-d48e-4623-b877-69f36aa8b011"
怎么了?
编辑:
控制器操作返回代码:
return Json(Url.Action("Economics", new { id = indicationBase.ID }));
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/"/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 }));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将控制器操作更改为仅返回 Id,现在我像这样重定向:
似乎工作正常。
I changed the controller action to just return the Id, and now I redirect like this:
Seems to work fine.