如何在单击浏览器后退按钮时设置默认页面? [英] How to set a default page on clicking the browser back button ?

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

问题描述

如何在点击浏览器后退按钮时设置默认页面?



例如:我正在使用一个具有一个Login Page.aspx的应用程序是一般网页形式和一个母版页和几个子页面。如果我登录并使用该应用程序,当我点击浏览器后退按钮时,它应该导航到登录page.aspx。





谢谢所有..

How to set a default page on clicking the browser back button ?

Ex: I'm using one Application which has One "Login Page.aspx" which is normal web form and One master page and several child pages . If i login and use the application and when i click on the browser back button it should naviagate to "Login page.aspx".


Thanks All..

推荐答案


尝试使用此代码,点击链接

解决方案到浏览器后退按钮单击事件处理 [ ^ ]





在此alret消息中你可以将重定向方法写入登录页面(最好的方式是退出页面),最好的方法是,你可以在该页面中使用注销页面加载事件你写清除所有会话,缓存,用户登录ID会话和重定向到登录页面,这是正确的方法,只是如果你重定向登录页面不好。



Redirect(logout.aspx);
Hi try to use this codes,click link
Solution to Browser Back Button Click Event Handling[^]


in this alret message u can write redirect method to login page (best way logout page),best way is ,u can use logout page in that page load event u write clear all sessions,cache,user login id session and redirect to login page ,this is proper way,simply if u redirect to login page is not good.

Redirect("logout.aspx");


如果你是使用表单身份验证,在配置设置中设置LoginUrl。



因此,当会话到期时,它会将用户指向登录页面。



现在,放弃用户会话,引导用户登录默认页面,浏览器缓存使用以下选项之一



< a href =http://www.codeproject.com/Tips/135121/Browser-back-button-issue-after-logout.aspx>参考 [ ^ ]



因此,在注销后显示历史页面的问题也可以解决。
If you are using Forms Authentication , set the LoginUrl in the configuration settings.

So that it Directs the User to the Login Page when ever the Session expires.

Now , Abandon the User Session which leads the user to Login default page, Browser Cache using one of the options below

Refer[^]

So that the issue related to showing the history pages after logout can be sorted out too.


这篇关于如何在单击浏览器后退按钮时设置默认页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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