title: Not able to redirect parent window to another page from modaldialog child window
body: <p>My requirement is as mentioned below:</p>
  
  <p>I have a modaldialog popup which I open using the following code:</p>
  
  <pre><code>window.showModalDialog('/test.jsp',window, 'center: yes; dialogHeight: 230px; dialogWidth: 550px; help: no;scroll:no;' );
  </code></pre>
  
  <p>I have a button in the modal dialog window which once clicked should close the popup and re-direct the parent window to login page.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>var par = self.parent;
  self.close();
  par.location.replace("/login.jsp");
  </code></pre>
  
  <p>Now what is happening that modal dialog is getting closed but instead of redirecting the parent window to login page, a new window opens up and loads this page inside that.</p>
  
  <p>Appreciated if  somebody could please give me some idea about the issue?</p>
  
  <p><strong>Additional information:</strong> </p>
  
  <p>My parent window is in frameset. To access parent's reference from child, normally window.opener is used but here in this case, I get this as undefined. Not sure why.</p>
  
  <p><strong>Answer:</strong></p>
  
  <pre><code>window.close()    
  window.dialogArguments.location.href = "/login.jsp"
  </code></pre>