Click here to Skip to main content
15,922,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to create an event which that is used when the user clicks on Browser(Firefox) Back Button.
The user should be able to logout from the application when it clicks on the back button.
I neither want to stay in the same page.
Posted

I have Referred this links when i wanted this functionality and its quite useful...

http://viralpatel.net/blogs/disable-back-button-browser-javascript/[^]

http://www.aspdotnet-suresh.com/2011/11/disable-browser-back-button.html[^]

http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911[^]

Hope This Help
------------------
Pratik Bhuva
 
Share this answer
 
Refer This:

Force Logout on Back Button[^]

Check solutions on that forum
 
Share this answer
 
Check this Tip/Trick(also take a look at comments section too)
Browser back button issue after logout[^]
 
Share this answer
 
Comments
Member 10284541 25-Oct-13 7:06am    
I already have my logout function.
but when i use my logout function like the below way it is asking for logout in every page.

function DisableBackButton() {
window.history.forward()
Logout();
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() }
window.onunload = function () { void (0) }

But i do not want in all the pages.
thatraja 25-Oct-13 8:29am    
That Tip/Trick has 5 options, you could some other options

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