[英]why it goes to a page when signout and press browser back button in c#, mvc
I'm creating a login in c#, mvc. 我在c#,mvc中创建登录名。 it works fine.
它工作正常。 Sign out is also working properly.
退出也可以正常工作。 But after user signed out, if user press back button it goes to the page where I redirect if login success.
但是,在用户注销后,如果用户按“后退”按钮,则会转到登录成功后重定向到的页面。 I tried with following by adding it to
global.asax.cs
. 我尝试将其添加到
global.asax.cs
。 but it didn't work. 但这没用。 And also I tried using javascript.
而且我尝试使用javascript。 At that time if user press back button it shows the page and disappears.
那时,如果用户按返回按钮,它将显示该页面并消失。 What can I do for that?
我该怎么办?
This is how I tried with c# 这就是我尝试使用C#的方式
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
protected void Application_BeginRequest()
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddMilliseconds(-10));
Response.Cache.SetNoStore();
}
please help me with this 请在这件事上给予我帮助
您无法清除用户历史记录,但是可以从成功登录后重定向用户的页面中添加未授权用户的重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.