Close Pop-up window and reload parent page

Joined
Mar 6, 2009
Messages
2
Reaction score
0
Hi,
I have a parent page with a dropdown box. The dropdown box is connected to a database. Here is how it functions....when you select the value "Add Names", a pop-up window opens up. This pop-up window has text box and a button. The user is expected to type a new name and click the button, upon doing that the name gets loaded into the database and closes the pop-up window.
Upon closing the window, I want the parent page to be refreshed such that the drop down box has the new name listed....and this is where I am not sure of.

Here is how my code looks in the pop-up window..

this.RegisterStartupScript("CloseAndReload", @"
<script language='javascript'>
window.close();
</script>
");

Can someone help me with this please.

Thanks,
VS
 
Joined
Mar 6, 2009
Messages
2
Reaction score
0
I also wanted to add that my parent page has other text boxes which have been filled with some values. So when I reload the parent page from the pop-up window, I would want the page to retain those text box values too.

Thanks,
VS
 
Joined
Sep 16, 2008
Messages
1
Reaction score
0
you can use the following one line of code to close popup window and at the same time it refresh the parent page.
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.location.reload();self.close();</script>");

happy coding
good luck
 
Joined
Jul 27, 2009
Messages
3
Reaction score
0
This work for me:
RegisterStartupScript("CloseWindow", "<script type=\"text/javascript\">window.opener.location.reload(false);self.close();</script>");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top