Update window behind lightbox.js window when lightbox.js window is closed

On my site I am using lightbox.js to open other urls on my site in a window above where the url is linked. The user enters in data, clicks a asp.net button, the data is updated and the window closes. Is there anyway to update the page that the lightbox window was opened on top of from the lightbox window?

http://www.huddletogether.com/projects/lightbox/
LVL 1
addicktzAsked:
Who is Participating?
 
tiagosalgadoConnect With a Mentor Commented:
Try

ClientScript.RegisterClientScriptBlock(this.GetType(),"script","window.opener.document.forms[0].submit();", true);
0
 
tiagosalgadoCommented:
Use the window.parent.refresh();
0
 
addicktzAuthor Commented:
Where would I put that at?

I tried using the following line of code at the end of the button click event from the child page and it didnt refresh the parent page, any ideas?

ClientScript.RegisterStartupScript(GetType(),"script","window.parent.refresh();", true);
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
addicktzAuthor Commented:
that didn't work ethier, any other ideas?
0
 
tiagosalgadoCommented:
Hum, very strange.

Try this instead
Page.ClientScript.RegisterStartUpScript(this.GetType(),"close","window.opener.location.reload(true);self.close();");

I assume that you're executing all code i gave before you send the close window command.

0
 
addicktzAuthor Commented:
I commented out the close window line and tried the different lines you gave me, the window doesn't close and the parent window does not update, any ideas?
0
 
addicktzAuthor Commented:
ok, I got it, thank you for your help! =]

I put this on the child page head

 <script type="text/javascript">
 function showMessage(pstrMessage)
 {
    self.parent.document.forms[0].submit();self.parent.myLytebox.end(); return false;
 }
 </script>

and on the child page submit postback i put

Page.ClientScript.RegisterStartupScript(GetType(), "script", "showMessage('Hello');", true);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.