troubleshooting Question

How to close a 2nd window and have it update the 1st window

Avatar of myester
myester asked on
9 Comments1 Solution356 ViewsLast Modified:
I am developing an app in Visual Web Developer 2005 Express. I have a page I'll call the Main page. On this page I have put a control. The first menu item has its NavigateUrl field set to ~/AddRide.aspx. I click on this menu item to bring up a second window where the user can enter data to add a new record to the database with the Submit button. When the user clicks the Submit button I want AddRide.aspx to close and then the Main page to update with the new record. In VS2003 I did this with

       Response.Write("<Script> window.opener.location=window.opener.location; window.close(); </script >")

in the CodeBehind file. It doesn't work in Visual Web Developer 2005 Express. I think it's because of the way I'm opening the AddRide.aspx window. In VS 2003 I opened that window with:

       Dim strPop As String
        strPop = "<script language='javascript'>'AddRide.aspx','Add_Ride','height=400, width=600, left=100, top=100');</script>"
        Page.RegisterStartupScript("Pop", strPop)

In Visual Web Developer 2005 Express I'm opening the AddRide.aspx window with the control. So my question is if I open the window with the control how can I close it and update the Main page.

Thanks for any help you can provide in my learning experience.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros