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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM