【发布时间】:2012-11-07 08:31:27
【问题描述】:
我正在尝试使用这行代码从 JavaScript 重定向到控制器
location.href = '/Dashboard/';
它重定向到仪表板,但在我的仪表板视图中,当文档加载时调用此方法
$.post("Dashboard/UsersGet", {}, function (dataSet) {
//do something with the dataset
});
然后我得到这个错误。
POST http://localhost:1414/Dashboard/Dashboard/UsersGet 404 (Not Found)
我可以看到仪表板被添加到 url 中两次。如何在不发生这种情况的情况下重定向到控制器?
【问题讨论】:
标签: javascript asp.net-mvc model-view-controller