Click here to Skip to main content
14,302,925 members
Rate this:
Please Sign up or sign in to vote.
See more:

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...
Updated 10-Dec-12 17:20pm

1 solution

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

Solution 1

One article at[^]

This is different approach then yours but it may help you to do the work you want at browser close.

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