I have this controller:
[Authorize]
[HttpPost]
public ActionResult ProfileSettings(ProfileSettingsInputModel model)
{
//some actions
WebSecurity.Logout();
return View(model);
}
So I must get view page, but I can't see it, because I've logout. But I can see it and don't move tp Login Url(I specify it in the Web.config). But if I press F5(Refresh this page) I redirect to Login page. Who can I redirect to it correctly(without refresh)/
Instead of
return View(model)
redirect to your login page. If you are using the default mvc:
return RedirectToAction("Login", "Home");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.