0

Clicking a button will call the below JavaScript function, which opens a aspx popup.

<script type="text/javascript">
    function btnName_onclick() {
      window.open("UpdateEmployee.aspx?empId=" + empId, 
      "UpdateEmployeeWindow", "width=800,height=450,scrollbars=yes,resizable=yes");
   }
</script>

If the update go well, I'd like to do 2 things:

  • Close the popup
  • Reload the parent page

I've tried Response.Redirect, but I'm getting the parent page also display in the popup. Is there another way to do obtain that?

Thanks for helping

Richard77
  • 20,343
  • 46
  • 150
  • 252

2 Answers2

0

You could just reload parent window, popup will be closed (you've opened on button click). So do smth like this window.location.assign("http://www.example.com")

W3School

Aleksej Vasinov
  • 2,662
  • 28
  • 29
0

Childs hold the parent properties, so you can try this function below

function reloadAndClose() {
    window.opener.location.reload();
    close();
}
Nico Griffioen
  • 5,143
  • 2
  • 27
  • 36
Akash Khan
  • 33
  • 1
  • 5