Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old June 23rd, 2004, 07:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

close Method
This method is used to close a specified window. If no window reference is supplied, the close() method will close the current active window. Note that this method will only close windows created using the open() method; if you attempt to close a window not created using open(), the user will be prompted to confirm this action with a dialog box before closing. The single exception to this is if the current active window has only one document in its session history. In this case the closing of the window will not require confirmation.

Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #12 (permalink)  
Old June 23rd, 2004, 08:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can try this for testing the second case said in my previous post regarding "only one document in its session history".

http://www.internet-nexus.com/books/vbscript/chap05.htm

1) open this URL.
2) scroll till the end of the page. (under Closing the browser window)
3) Do a SHIFT + mouse click on "close method" link there. Then try closing that new window resulted, from this step by clciking the button shown there. This does not ask for confirmation
4) Try clicking the "close method" link on that page without "SHIFT KEY press". Now, in this method, it would ask for confirmation to close the browser window.

Hope that explains.
Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #13 (permalink)  
Old June 23rd, 2004, 08:18 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

hello happygv,

Just for an interest sake. Is there any way to prevent the confirmation from appearing (if the window is not opened with the help of window.open method / target=_blank) ?

thanks
Reply With Quote
  #14 (permalink)  
Old June 23rd, 2004, 08:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

AFAIK, I dont think that is possible. May be someone come up with a work around for that, still that could be a rare possibility, as it is about controlling the behaviour of the browser.

You can, if its session history has just that one document, like you see here in this p2p.wrox website, when you subscribe to a forum/topic, that opens up a new window saying you are subscribed, and that closes without any confirmation, as it has just that one document in its history.

Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #15 (permalink)  
Old June 23rd, 2004, 11:57 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

There is a secret way to close the window without the prompt box, it uses JavaScript.

window.opener=top;
window.close();

Redirect to the user's home page:

location.replace("about:home"); //dont enter into history, or...
location = "about:home"; //do enter into history

HTH,

Snib

<><
Reply With Quote
  #16 (permalink)  
Old June 23rd, 2004, 11:35 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

Hi snib,

Thanks a lot for the so simple solution. This makes me satisfy a long sought request of one of my client.
Reply With Quote
Reply


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
Browser close when screen saver close Rehanrana Pro VB 6 1 April 7th, 2008 03:09 AM
How to close browser window? rupen Javascript How-To 14 July 31st, 2006 10:52 AM
handling script errors using vb web browser state Beginning VB 6 3 January 19th, 2006 09:01 AM
trying to close browser in a button taliosfalcon ASP.NET 1.0 and 1.1 Basics 1 February 7th, 2005 12:11 AM



All times are GMT -4. The time now is 06:38 AM.


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