MVC后台页面跳转的方法 笔记

通过ajax进行跳转:

$.ajax({
url: "/Home/Login",
type: "post",
data: { Account: account, Password: password },
success: function (result) {
if (result = "登录成功") {
window.location.href = '/Home/AccountDetailed';
}
alert(result);
}
});

控制器进行跳转: 

return View();  return View("Create");

return Redirect("Index?age=1");  return Redirect("Create"); return Redirect("/Home/Index");

return RedirectToAction("Index", "Home");

posted @ 2018-11-22 10:10  提笔  阅读(1266)  评论(0编辑  收藏  举报