我想重定向到同一 Controller 中的另一个 Action 。
我们怎样才能做到这一点?
我试着喜欢回来
RedirectToAction("NotAuthorized");
最佳答案
return RedirectToAction("ActionName");
代替
return Redirect("/Elearning/NotAuthorized");
这样做:return RedirectToAction("NotAuthorized"); // if you're inside the Elearning controller
或者
RedirectToAction("NotAuthorized", "Elearning"); // if calling from other controller
关于asp.net-mvc - 如何重定向到同一 Controller 中的另一个 Action ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10353931/