[top-posting corrected]
would it be possible with som javascript.. calling a webservice ?
Not reliably... The JavaScript would fire every time the page closes i.e.
while moving from page to page within the same web app, and also during
postback etc...
Hi,
what Mark is said is absolutely true and i found a little workaround
to that...
here is the code i tried and found working on both IE and Firefox...
<body onbeforeunload="doUnload()" onmousedown="somefunction()">
<form id="form1" runat="server">
</form>
</body>
<script language="javascript" type="text/javascript">
var isClose = false;
function somefunction()
{
isClose = true;
}
function doUnload()
{
if(!isClose)
{
alert('window is closing');
}
}
</script>
this code is not perfect ... you guys can find some flaw ... still it
works... for most of the cases...
Best of luck
Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog