我正在尝试对旧版 asp.net mvc4 应用程序进行标准化。在 Angular js Controller 内执行 Web api http.put 后,我希望将页面定向到另一个 asp.net mvc4 操作/ Controller 。怎么可能?
$scope.saveEditProfile = function () {
$http.put("/api/ProfileWeb", $scope.profile)
.then(function(response) {
$scope.profile = response.data;
});
//这里需要某种重新路由指令来路由到 asp.net mvc Action = Inedex 和 Controller =Profile。
};
最佳答案
您可以使用
window.location ="/Profile/Index";
即:
$scope.saveEditProfile = function () {
$http.put("/api/ProfileWeb", $scope.profile)
.then(function(response) {
$scope.profile = response.data;
window.location ="/Profile/Index";
});
};
关于asp.net-mvc - 使用 Angular js Controller 重新路由到 mvc4 中的另一个操作/ Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26550093/