Hi,
I tried some code try this for your requirement.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script language ="javascript">
function f1() {
alert(window.closed);
}
</script>
</head>
<body onunload ="f1()" >
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Check above code and use that code by changing some code as for your requirement.
All the Best