Click here to Skip to main content
15,896,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear,
All...

I need an alert message when I close the browser close(X) button. I googling on this issue, but answers are use onbeforeunload() method in body tag of the form. But when am using master page contained forms there is no body tag to call this method. I this case what i should do? please let me know, if anybody knows the solution. without using body tag in the form. when am using this onbeforeunload() in body tag, but when i refresh the page this alert firing. this alert message not fired when refresh the page.

Thanks in advance...
Posted
Updated 10-Dec-12 17:20pm
v2

1 solution

Well,
One article at http://blkarwasara.blogspot.com/2012/01/detecting-close-button-of-browser-by.html.[^]

This is different approach then yours but it may help you to do the work you want at browser close.
-Milind
 
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