Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 16th, 2008, 10:55 PM
Authorized User
 
Join Date: Dec 2006
Location: Manila, , Philippines.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to h@ckerz Send a message via Yahoo to h@ckerz
Default Closing all child window when browser is closed

Hi all,
I just want to ask help for my problem in my page.

Scenario 1:

I have two page, Page1(the default page) has created a child window when i go to page2 the child window created in Page1 is still open, then now Page2 created its own child window. When i close the browser how can i close the child window created by Page1. Since Page2 can easy close its child created using window.close.

Sceanrio 2:

I have two page, Page1(the default page) has created a child window when i go to page2 the child window created in Page1 is still open, then now Page2 created its own child window. When i click logout all child window created by Page1 and Page2 will be closed.


I hope you can help me this.

Part of requirement is not to close the child window created by Page1 when going to Page2.




................ h@ckerz ....................
If you can't join them.....HACK them
..................................................
__________________
................ h@ckerz ....................
If you can\'t join them.....HACK  them
..................................................
  #2 (permalink)  
Old July 17th, 2008, 01:04 AM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I *THINK* this will work:

(1) Make sure that every window has a name. That is, when you create the window, make sure you give it a name:
    window.open("childPage.aspx", "CHILD", "...whatever..." );
and from the child:
    window.open("theBaby.aspx", "GRANDCHILD", "..." );

(2) Later, when you need to "find" that same window again (in page2 or wherever) you find it thus:
    var kid = window.open( "", "CHILD" );
notice the lack of URL there.

That *should* find the window and then you can do
    kid.close( );

BUT...

But I don't know if your user will get one of those annoying "an application is trying to close this window..." messages.

And the answer might vary by browser.

Let me know. I'd try it, but I need to get to sleep.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close Child window automatically on closing parent vikas67k C# 1 August 26th, 2008 02:00 AM
Closing parent window from child window arnabghosh Javascript How-To 1 December 26th, 2007 01:18 AM
problem with closing the child window swarnap Javascript How-To 4 November 16th, 2006 12:54 AM
closed parent window when opened child window jaiwin Javascript How-To 0 October 8th, 2006 12:54 PM
Closing Child Window nickiii General .NET 2 March 31st, 2005 12:05 PM



All times are GMT -4. The time now is 05:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.