[英]Don't redirect to Login page
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). 但是我可以看到它并且不会移动tp Login Url(我在Web.config中指定了它)。 But if I press F5(Refresh this page) I redirect to Login page. 但是,如果我按F5(刷新此页面),则会重定向到“登录”页面。 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: 如果您使用默认的mvc:
return RedirectToAction("Login", "Home");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.