1. 程式人生 > >MVC後臺頁面跳轉的方法 筆記

MVC後臺頁面跳轉的方法 筆記

key span word cati 控制 $.ajax cti ref clas

通過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");

MVC後臺頁面跳轉的方法 筆記