• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 581
  • Last Modified:

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/
0
addicktz
Asked:
addicktz
  • 4
  • 3
1 Solution
 
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
 
tiagosalgadoCommented:
Try

ClientScript.RegisterClientScriptBlock(this.GetType(),"script","window.opener.document.forms[0].submit();", true);
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now