如何重定向到同一个控制器中的另一个动作?

din*_*esh 9 asp.net-mvc redirect action controller asp.net-mvc-3

我想重定向到同一个控制器中的另一个动作.我们怎样才能做到这一点?我试着回来

RedirectToAction( "NotAuthorized");

Len*_*rri 14

return RedirectToAction("ActionName");
Run Code Online (Sandbox Code Playgroud)

而不是return Redirect("/Elearning/NotAuthorized");这样做:

return RedirectToAction("NotAuthorized"); // if you're inside the Elearning controller
Run Code Online (Sandbox Code Playgroud)

要么

RedirectToAction("NotAuthorized", "Elearning"); // if calling from other controller
Run Code Online (Sandbox Code Playgroud)