Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Provided Answers: 1

    Unanswered: Close Classic ASP popup window by name

    Good day,

    I have a classic ASP page, it cannot be converted to anything else, has to stay classic ASP.

    When a user clicks a particular button I have a popup window that displays some information to the user while in the background there is some processing and navigation to other pages and so on.

    What I need is for when a particular line of code on one of the redirected pages is reached that this popup window is closed.

    How can I do this? Is it possible to close a window by name such as window.close("PopupWindow")

    Please can someone help.

  2. #2
    Join Date
    Nov 2004
    Provided Answers: 1
    To elaborate a bit more.

    Page1.asp will open the PopupWindow. Page1.asp then navigates to Page2.asp to do something and then Page2.asp navigates to Page3.asp. When all processing on Page3.asp is finished then I want to close PopupWindow.

    Is this possible. Open a popup window from a screen that never opened the popup.

  3. #3
    Join Date
    Jan 2007
    Provided Answers: 10
    It looks like you're using Javascript.

    In which case I have a three part answer....

    Q: Can I close a specific window from a parent?
    A: Yes!
    var popup_window ="");
    Q: If I navigate to a different "parent" page, can I still close the popup?
    A: Not directly...

    The reason for this is due to the scoping of variables in JS. Once you change page, you lose references to what you had on the previous page.

    Q: Can I pass a Javascript object between pages?
    A: Yes, it is possible.

    Most methods involve serialising the object, passing it around, and de-serialising it when you need it.

    Most modern browsers have HTML5 storage available and this is one of the easiest places to chuck "globals" such as this.

    As for [de-]serialisation, JSON is probably the place you should start looking

    Hope this helps!
    Home | Blog

  4. #4
    Join Date
    Nov 2004
    Provided Answers: 1
    I found a way to do what I need to. When the popup page is opened it is opened given a name to it. Then on my page 3 I open the window again and give it the same name, this causes the original window to relaod as it is the same name. The second time I open it, on the page3.asp, I open it passing a variable in the query string. In the opening of the popup I then check if the variable is there and populated and if so I close the window otherwise leave it open. Probably a bit of a long way to do it but it worked and worked really well and simply I found.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts