Hello Mark Rae [MVP],
yep, my mistake, somehow thought about page close :) not browser
actually, returned to OP quesion there is no 100% way to handle BROWSER closing
what OP could try is to handle top X/Y position and ALT+F4 key
function handleWindowClose()
{
if((window.event.clientX<0) || (window.event.clientY<0))
{
event.returnValue = "Closing by X button";
}
}
if (event.altKey==true && event.keyCode==0 )
{
alert("ALT + F4 ");
}
but thes wont handling closing page from toolbar or killing process from
task manager
---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
M"Michael Nemtsev [MVP]" <ne*****@msn.comwrote in message
Mnews:90**************************@msnews.microsof t.com...
M>
>>>No doubt you'll receive other replies suggesting possible solutions
with the unload and/or beforeunload events - none of those works
reliably...
Yep, you can use onbeforeunload of the body < body
onbeforeunload="BrowerClose();"and make ajax call to the
web-service
http://www.asp.net/ajax/documentatio...nsumingWebServ
icesWithAJAXTutorial.aspx
MNo you can't. That will fire every time the page closes i.e. moving
Mfrom one page to another, not just when the browser closes...
M>
>it's a common practice for this
MNo it isn't - because it doesn't work...
M>