hi, i got a web page and when browser fire Closing Event i wanna stop it ? How can i do that in asp.net or anyother alternative?
+8
A:
You can't, and you shouldn't be able to. How would you feel if StackOverflow were able to prevent you from closing your browser?
Joel Coehoorn
2009-06-05 15:30:19
Somehow I think they already do...
Keltex
2009-06-05 15:32:57
I can close it- I'm just compelled to re-open it again ;)
Joel Coehoorn
2009-06-05 15:36:23
Mine seems to pop-up on its own as part of the build process for every single project I am on. Weird.
Rob Allen
2009-06-05 16:18:08
+1
A:
hi you cannot really stop it, but if needed you can warn the user that session informations or whatever will get lost....
<html>
<script type="text/javascript">
var isdone=false
</script>
<body onbeforeunload="if(!isdone) return 'Do you really want to close!';">
</html>
nWorx
2009-06-05 15:36:42
A:
There truly is no way to stop the user from closing the browser.
However, you could potentially write some javascript, which would open up a new window when the user leaves the current page (aka closes the browser, clicks on another link).
This would be a bit annoying to your users, and also would probably be blocked by Pop-Up Blockers.
But it is somewhat possible.
Jack Marchetti
2009-06-05 16:04:17