Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Dear All,


In My Application when user clicks on Back button then all sessions are killed,but users are clicking on Navigation bar of browser so sessions are not killed.

can any body gives idea which helps me
Posted
Comments
ZurdoDev 10-Dec-13 7:36am    
What's the question?

Add following code snippet.....hope it helps !!

JavaScript
<script type="text/javascript">
window.history.forward();   
function noBack() 
{ window.history.forward(); } 
</SCRIPT> 
</HEAD> 

<BODY onload="noBack();"     
onpageshow="if (event.persisted) noBack();"  onunload=""> 
</script>
 
Share this answer
 
Try this ,
C#
protected void Back_button_click(object sender, EventArgs e)
    {
        Session.RemoveAll();
        Response.Redirect("pathOf_Page");

        
    }


for more information left your comment.
 
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