Click here to Skip to main content
14,302,925 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100