Click here to Skip to main content
15,898,770 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
when i press backspace button my admin page opens in spite i have ended the session
Posted

Think of the browser cache. If you are concerned then you need to clear the back button functionality using some javascript code.

<script language="JavaScript">
window.history.forward(1);
</script>
 
Share this answer
 
You can clear browser history through JavaScript....
JavaScript
//clears browser history and redirects url
<SCRIPT LANGUAGE=javascript> {  var Backlen=history.length;   history.go(-Backlen);   window.location.href=page url }</SCRIPT>

OR
C#
Page.ClientScript.RegisterStartupScript(this.GetType(),"cle","windows.history.clear",true);

OR as you say in you logout event:
C#
protected void LogOut()   
{       
     Session.Abandon();       
     string nextpage = "Logoutt.aspx";       
     Response.Write("<script language=javascript>");             
     Response.Write("{");       
     Response.Write(" var Backlen=history.length;");       
     Response.Write(" history.go(-Backlen);");       
     Response.Write(" window.location.href='" + nextpage + "'; ");
     Response.Write("}");       
     Response.Write("</script>");   
}
 
Share this answer
 
Thank you very much. You dont know how you have solved my problem. Thank you very much
 
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