Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Scripting > Javascript   »   How to close window with deep hierarchy

 
Thread Tools Display Modes
Question
 
 
#1  
Old Aug 13, 2007, 07:15 PM
styleepop
New Member
styleepop is offline
 
Join Date: Aug 2007
Posts: 1
styleepop See this member's comment history on his/her Profile page.
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

Reply With Quote
 
     

Answers
 
 
Old Aug 14, 2007, 09:48 AM   #2  
Full Member
jstrike is offline
 
Join Date: May 2007
Location: Wisconsin - Go Packers!
Posts: 391
jstrike See this member's comment history on his/her Profile page.
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.
  Reply With Quote
 
     


Thread Tools
Display Modes

 
Similar Sponsors

Similar Threads
Question Asker Forum Answers Last Post
how to close all the childwindows(popup window) when closing the parent window krisamigo Javascript 3 Aug 15, 2008 11:36 AM
close all child windows thru parent window srinivask12 Javascript 1 Jul 16, 2007 05:38 AM
close all child windows thru parent window zybernau Other Web Development 0 Mar 22, 2007 09:46 AM
How to close a power window in open position? TR2007 Cars & Trucks 3 Mar 2, 2007 05:01 PM
Old wooden window won't close mikestorm Exterior Home Improvement 8 Dec 16, 2005 02:01 PM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 02:54 AM.