Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How can i stop the back button after user has logout ?The logout button is in MASTER PAGE

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.
SQL
How do i avoid this.Pls help me with the code

 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.
Posted
Updated 21-Feb-14 0:00am
v2

 
Share this answer
 
1. First, do this for all your restricted pages:
check-session-variable-and-redirect-to-login-page-before-page-load[^]
2. When a user logs out: Kill+Session+with+Logout[^]
Read more: Exploring Session in ASP.NET[^]
 
Share this answer
 
v2
Comments
Challa92 21-Feb-14 5:53am    
The Logout button is in Masterpage
Peter Leow 21-Feb-14 6:01am    
Just attach the kill session code to the logout button does not matter where it is. The key issue is that your application must be able to determine if he is still log in or not at every restricted page.
 
Share this answer
 
v2
Javascript:
XML
<script>
function goForward()
  {
  window.history.forward()
  }
</script>



C#
<button onclick="goForward()">Click</button>
 
Share this answer
 

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