Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB.NET ASP.NET4.0
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 11-Oct-12 19:23pm
Edited 10-Dec-12 17:20pm
v2

1 solution

Rate this: bad
good
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
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.141022.1 | Last Updated 10 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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