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