title: ASP.NET Refresh Parent Page after Closing Modal Dialog Window
body: <p>I have an ASP.NET page that launches a modal dialog window:</p>
  
  <pre><code>Dim sURL As String = System.Configuration.ConfigurationManager.AppSettings("PAYORS_Path") &amp; "PayorCopy.aspx"
      lnkCopy.Attributes.Add("onclick", "javascript:window.showModalDialog('" &amp; sURL &amp; "',null,'status:no;dialogWidth:375px;dialogHeight:550px;dialogHide:true;help:no;scroll:yes;center:yes');return false;")
  </code></pre>
  
  <p>The user can create new items in this modal window.  When the user clicks the Close button the modal dialog window is successfully closed, but the new items created do not appear on the parent page.  When the modal window is closed I would like the parent page to refresh to show the new items the user created.  Currently:</p>
  
  <pre><code>Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnClose.Click
      Dim strjscript As String = "&lt;script language='javascript'&gt;self.close();&lt;/script&gt;"
      LtClose.Text = strjscript
  End Sub
  </code></pre>
  
  <p>I have tried adding to this script:</p>
  
  <pre><code>window.opener.location.reload(true);
  </code></pre>
  
  <p>But then when I test I get an error that says "Unable to get value of the property 'location': object is null or undefined."</p>
  
  <p>Any help would be much appreciated!</p>