如何禁用当用户注销在asp.net C#在浏览器中的后退按钮 [英] How to disable the back button in browser when user logout in asp.net c#

查看:273
本文介绍了如何禁用当用户注销在asp.net C#在浏览器中的后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的问题是,我们能够在注销清除会话。

Our problem is we are able to clear session on logout.

但是,如果用户单击后退按钮,那么他/她可以通过所有previous屏幕。

But if a user clicks the back button then he/she can go through all previous screens.

但优点是,在任何这样的$ P $的一个单一的点击pviously冲浪带来的页面用​​户登录页面的时候,我们已经做到了。但是,我们的要求是,我们不应该让用户去通过previously冲浪页面。

But the advantage is that on a single click on any of of such previously surf page bring user to login page back ,we had done that. But our requirement is we should no allow user to go through the previously surf page.

推荐答案

您需要强制缓存过期这个工作。我在寻找适合你的code样本。

You need to force the cache to expire for this to work. I'm looking for the code sample for you.

修改结果
发现这个对你来说,它已经在这里讨论了关于左右。

EDIT
Found this for you, its already been addressed here on SO.

Page.Response.Cache.SetCacheability(HttpCacheability.NoCache)

<一个href=\"http://stackoverflow.com/questions/533867/whats-the-best-method-for-forcing-cache-expiration-in-asp-net/534296#534296\">Here...

这篇关于如何禁用当用户注销在asp.net C#在浏览器中的后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆