How to refresh parent page on close of popup window by toolbar close button
How to refresh parent page on close of popup window by toolbar close button
1. Create a Page default.aspx
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
//Method is used for Open a Url in Popup window.
function openPopup() {
open('Default2.aspx', "Page", "status=1, width=350, height=150, top=300, left=500,location=no,resizable=yes,scrollbars=1,toolbar=no,directories=no,status=no,menubar=no");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<a href="javascript:openPopup()">Open Popup Window</a>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
//Method is used for Open a Url in Popup window.
function openPopup() {
open('Default2.aspx', "Page", "status=1, width=350, height=150, top=300, left=500,location=no,resizable=yes,scrollbars=1,toolbar=no,directories=no,status=no,menubar=no");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<a href="javascript:openPopup()">Open Popup Window</a>
</form>
</body>
</html>
2. Create pop window page default2.aspx
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
window.onbeforeunload = function () {
window.opener.location.href = window.opener.location.href;
}
</script>
</head>
<body>
<form id="form1" runat="server">
This is a Test Page
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
window.onbeforeunload = function () {
window.opener.location.href = window.opener.location.href;
}
</script>
</head>
<body>
<form id="form1" runat="server">
This is a Test Page
</form>
</body>
</html>
Awesome....
ReplyDelete