如何prevent浏览器后退按钮注销后? [英] How to prevent browser back button after logout?

查看:134
本文介绍了如何prevent浏览器后退按钮注销后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何停止后退按钮后,用户已注销?
(注销按钮位于主页)
使用web表单

How can i stop the back button after user has logout ? (LOGOUT button is in master page) Using webforms

我有几页,最后一页的最后一页并注销后,当我点击后退按钮它显示了previous page.How做我避免this.Pls帮助我的code

I have few pages, the last page is the final page and after log out when i click back button its showing the previous page.How do i avoid this.Pls help me with the code

code需要触发后才注销。用户必须能够回去看看ňprevious页面,如果他有做任何的变化,而他的loged。

Code needs to trigger only after LOGOUT .The user must be able to go back n see previous page if he has to make any changes while he's loged in.

推荐答案

您应该设置正确的HTML头。据<一个href=\"http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers\">this这些都是在所有浏览器工作的:

You should set the correct HTML headers. According to this these are the ones that work on all browsers:

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

您可以将它们像这样:

HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache, no-store, must-revalidate");
HttpContext.Current.Response.AddHeader("Pragma", "no-cache");
HttpContext.Current.Response.AddHeader("Expires", "0");

这篇关于如何prevent浏览器后退按钮注销后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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