簡體   English   中英

為什么退出時會轉到頁面並在c#,mvc中按瀏覽器后退按鈕

[英]why it goes to a page when signout and press browser back button in c#, mvc

我在c#,mvc中創建登錄名。 它工作正常。 退出也可以正常工作。 但是,在用戶注銷后,如果用戶按“后退”按鈕,則會轉到登錄成功后重定向到的頁面。 我嘗試將其添加到global.asax.cs 但這沒用。 而且我嘗試使用javascript。 那時,如果用戶按返回按鈕,它將顯示該頁面並消失。 我該怎么辦?

這就是我嘗試使用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();
}

請在這件事上給予我幫助

您無法清除用戶歷史記錄,但是可以從成功登錄后重定向用戶的頁面中添加未授權用戶的重定向。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM