<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
window.onbeforeunload = function(e) {
e = e || window.event;
e.returnValue = "Your message here";
};
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
You can use the same script on ASP.NET pages too
Tweet
1 comment:
The pop-up is shown even if you navigate to other page of your own website. I wanted a solution wherein the user will be altered ONLY if he is closing the Browser window. Can you pls provide any pointers?
Sandeep
http://sandeep-aparajit.blogspot.com
Post a Comment