Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I control the user closes the browser?
The user is asked?
Are you sure the browser is closed?
Asp.net
Posted
Comments
Richard C Bishop 16-Nov-12 14:25pm    
Do you mean you want to ask the user if they are sure they want to close the browser?

See this article I think it help you...
Article: Save Changes on Close of Browser or When Exiting the Page.
 
Share this answer
 
You could handle the javascript onbeforeunload event[^] but it is not likely to work for all browsers - no solution is. It will work in IE, but probably not in most of the others.

There is no single, simple solution which will do what you want.
 
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