1

I am opening a popup window B from page A using:

this.Page.ClientScript.RegisterStartupScript(  
      this.GetType(), 
      "JavaScript", 
     "myWindow=window.open('B.aspx',
     'WindowName',
     'copyhistory=no, 
     width=800, 
     height=300, 
     top=150, 
     left=50, 
     resizable=1, 
     scrollbars=1');
     myWindow.focus();", 
     true
);

I want to refresh page A whenever there is a change in popup window B.

hsuk
  • 6,770
  • 13
  • 50
  • 80

2 Answers2

1

There are many ways to do it:

<script>
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }
</script>

<script language="JavaScript">
<!--
function refreshParent() {
  window.opener.location.href = window.opener.location.href;

  if (window.opener.progressWindow)

 {
    window.opener.progressWindow.close()
  }
  window.close();
}
//-->
</script>

Sources:

Open popup and refresh parent page on close popup

http://forums.devarticles.com/javascript-development-22/auto-refresh-parent-window-after-closing-popup-4864.html

Refresh parent window when the pop-up window is closed

Community
  • 1
  • 1
Alex
  • 5,971
  • 11
  • 42
  • 80
0

Call refreshParent on user actions as :

function refreshParent() {
     window.opener.location.href = window.opener.location.href;
}
hsuk
  • 6,770
  • 13
  • 50
  • 80
hungryMind
  • 6,931
  • 4
  • 29
  • 45