Ask Experts Questions for FREE Help !
Ask
    styleepop's Avatar
    styleepop Posts: 1, Reputation: 1
    New Member
     
    #1

    Aug 13, 2007, 08:15 PM
    How to close window with deep hierarchy
    Friends.. this is my first mesg to this group..
    Thanks in advance..

    When I click on CLOSE asp button.. it should do some saving process at server side and close that window and all its child windows if any.

    How can I handle this situation.

    I tried with window.close()
    Its not working.

    Actaully my page is inside an user control

    The hirarchy is like the below..

    1. Default.aspx(static)

    Usercontrol(static)

    Welcome.aspx page(static)

    Usercontrol(static)

    Welcomestep1.aspx(changes on button click)


    Now I should close the enitire page from welcomestep1.aspx
    jstrike's Avatar
    jstrike Posts: 418, Reputation: 44
    Full Member
     
    #2

    Aug 14, 2007, 10:48 AM
    You can probably fake out a server call with some JavaScript.
    (This is just off the top of my head, I'll let you try to implement it)
    Code:
    body onbeforeunload="saveInformation();"
    .
    .
    .
    script
    function saveInformation() {
      var srvrCall = new Image();
      srvrCall.src = "http://url & parameters for your server side code";
    }
    /script
    That's it in a nutshell. When you try to close the page the saveInformation function will get called. It will create an image object in JavaScript and set the source to whatever URL you want. The browser will naturally make a call out to that URL to try to retrieve the image. You can put your parameters on there and call your backend server code. Your code will get executed and the page will close.

    I've done similar things before, using Java on the back end, with good results.

    HTH.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Close all child windows through parent window [ 1 Answers ]

Hi, all In javascript I need to close all the child windows that I have opened through a parent window Scenario: here i will be having as many as child window opened and name given to the child window can not be tracked because each will be having a different name, and i am using 70...

How to close all the childwindows(popup window) when closing the parent window [ 3 Answers ]

Hi, all In javascript I need to close all the child windows that I have opened through a parent window Scenario: Here I will be having as many as child window opened and name given to the child window can not be tracked because each will be having a different name, and I am using 70 to...

Close all child windows through parent window [ 1 Answers ]

I want answer for the above question asapp

How to close a power window in open position? [ 3 Answers ]

'93 Integra - p/s window is in open position. I am waiting for a new Master Switch for the driver's side because I read that this was common fault w/problems. If this doesn't work, anyone help w/how to jump the motor to close the window? Also, how can I check if motor has gone south on me w/o...

Old wooden window won't close [ 8 Answers ]

I have a wooden window that jams about 6" from the bottom. It seems to jam on the left side and there's a small pile of sawdust in that corner. It doesn't look like the individual sliding parts of the window can be removed. Any advice?


View more questions Search