浏览器后退按钮注销后禁用问题

浏览器后退按钮注销后禁用问题

本文介绍了浏览器后退按钮注销后禁用问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我的应用程序中有一个页面控制器类,从中继承了所有页面。并且这个班级检查会话并处理它们。 现在我面临一个问题,如果我登录在我的应用程序中,让我们说从 page1 我点击退出, 我将被重定向到 Login.aspx 如果会话还活着,或者 Login.aspx?SessionExpired 如果会话已过期。 但在这两种情况下,如果我按下浏览器的后退按钮,它只会重定向到 Page1 。 我已阅读并尝试了许多文章,包括CP上的以下内容。 浏览器后退按钮问题 和与Sandeep 。 但仍然发生了同样的事情。我试图清除一个页面的缓存,而不是让用户从这个页面注销,比预期的,它被重定向到 Login.aspx?QueryString ,但当我推动从浏览器返回按钮,这个页面显示...... :(即使我清除了它的缓存。 编辑:i have a page controller class in my application from which all the pages are inherited. and this class checks for the session and handle them.Now I am facing an issue, if i log in to my application, and let say from page1 i click signout,I will be redirected to Login.aspx if session was alive or to Login.aspx?SessionExpired if session has been expired.But in both the cases, if i press Browser's back button, it simply redirects to Page1.I have read and tried many articles including the following on CP.Browser Back button Issueand By Sandeep.but still same is happening. I tried to clear cache of one page and than put user to logout from this page, than as expected, it was redirected to Login.aspx?QueryString, but when i push the back button from browser, again this page shows... :( even though I cleared its cache.protected void Page_Load(object sender, EventArgs e) {//trying the above mentioned link code to clear the cache of current page.Response.Buffer= true;Response.ExpiresAbsolute=DateTime.Now.AddDays(-1d);Response.Expires =-1500;Response.CacheControl = "no-cache";//calling the session handling controller class//page is inherited from this page. base.Page_Load(sender, e);//MY COde here} 任何人都可以给我一些想法???Can anybody give me some idea???推荐答案Create a HTTP Module FileRefer the HTTP Module File in your web.configso when ever the application loads any page this maodule will be included in the Page life cycle process, so that you can check for the proper user authorization & Authenticatinthrough some session or cookie data if the user pressed logout, probably you may cleared those cookie / session values. 此HTTP模块文件将检查值是否为值为null然后自动将页面重定向到Login.aspx或指定的页面。 注意:HTTP模块文件将在Page之前调用加载所有页面。 实施HTTP模块 [ ^ ] 谢谢!This HTTP Module File, will check for the values if the values are null then automatically redirects the page to Login.aspx or the page specified.Note: HTTP Module File will be called before Page Load of all pages.Implementing HTTP Module[^]Thanks! 这篇关于浏览器后退按钮注销后禁用问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-06 06:32