Asp.net-Mvc
如何重定向到同一控制器中的另一個動作?
我想重定向到同一控制器中的另一個動作。我們怎樣才能做到這一點?我試過回來
RedirectToAction(“未授權”);
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
嘗試
return RedirectToAction("SomeAction");