Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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..
Posted

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");
 
Share this answer
 
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.
 
Share this answer
 
Comments
MohammedRuman 29-Jan-14 5:07am    
As i'm using Master page here when ever I move from one page to another I should go to master page and then i should move to other page . if i give session Abandon in the master page then i cannot move from page 1 to page 2 as i'm using same master page for both page1 and page 2. I need solution such that i could move easily from page 1 to page 2 but if i move from page 2 to page 1 then session should get expire and it should move to the Login page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900