0

I have one asp.net page , it consists of some controls along with a close button. If the user clicks on the close button, it will open ModaldialogBox with one text box for entering closing reason. Once the user enters the reason and clicking on the save button, the modal popup shows the alert message and close the modal popup. The existing code for this is shown below.

this.Page.ClientScript.RegisterStartupScript(GetType(), "close", "alert('" + Message + "');var xWin=window.dialogArguments;xWin.location.replace(xWin.location);window.close();", true);

My requirement is that, once the user click on the submit button, I have to navigate to the dashboard page after closing the modal popup window.

I had tried window.location.href after the window.close(), It will open another window and displyed the page. But it should navigate from the existing asp parent page. Please help me for resolving this issue.

Thanks in advance

MAC
  • 6,277
  • 19
  • 66
  • 111

1 Answers1

2

redirect the parent window with following code

window.opener.parent.location.href = 'dashboardurl';
Raab
  • 34,778
  • 4
  • 50
  • 65
  • its showing Microsoft Jscript runtime error: 'window.opener.parent' is null or not an object – MAC Feb 28 '13 at 07:17