从应用程序注销后,浏览器prevent后退选项 [英] Prevent Back option in browser after logout from the application

查看:156
本文介绍了从应用程序注销后,浏览器prevent后退选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个ASP.NET应用程序。我想prevent使用浏览器的后退按钮从应用程序退出后查看previous页面的用户。

I am working on a ASP.NET application. I want to prevent the user from viewing the previous page using the back button in the browser after logging out from the application.

推荐答案

感谢您为您的所有答复。

Thank You for all your replies.

code:

  Response.Cache.SetCacheability(HttpCacheability.NoCache);
  Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
  Response.Cache.SetNoStore();
  Response.AppendHeader("Pragma", "no-cache");

我已经使用页面加载事件此code。其工作罚款。

i have used this code in page load event. Its working fine.

这篇关于从应用程序注销后,浏览器prevent后退选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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