Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2003, 08:54 PM
Authorized User
 
Join Date: Oct 2003
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default Closing browser using a Button

Hi, all
I have a frameset (frameset.asp) with 3 frames in it Top.aspx, Left.aspx and main.aspx
When a user click a button in left.aspx I want to either terminate the session (logout),
or just close the browser window.

I've tried this code in the click event handler of the button:
Response.Write("<script>window.close();</script>")

But for some reason it does not work..

Can anybody out there help me with this?

PS.I also have an ASP:Repeater in left.aspx does that cause any trouble?

Thanks!

------------------------
All help is Good help!
Regards
Michael
__________________
------------------------
All help is Good help!
Regards
Michael
 
Old December 17th, 2003, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

If vb6 I used the MS Internet Controls and then added this code:

Set Explorer = New SHDocVw.InternetExplorer
Explorer.Visible = True 'opens the browser
Explorer.Navigate = myUrl
Explorer.Visible = False 'closes the browser

I haven't moved the app over to .net so I'm not sure how you would do it. But I'm sure it's similar.

 
Old December 17th, 2003, 04:13 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I think the problem you are having is that the "window" reference is only referencing the frame. Try "window.top.close();".

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 18th, 2003, 02:06 PM
Authorized User
 
Join Date: Oct 2003
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You struck it right on the money as always Peter..

Thanks for another helpfull tip...

------------------------
All help is Good help!
Regards
Michael





Similar Threads
Thread Thread Starter Forum Replies Last Post
closing browser prv299 ASP.NET 2.0 Professional 1 June 5th, 2008 09:15 AM
browser closing vamsivaila Pro Java 0 January 3rd, 2007 06:43 AM
Determine method of closing browser chrscote Javascript How-To 2 August 31st, 2006 05:34 AM
Delete files on closing browser spacy ASP.NET 1.x and 2.0 Application Design 7 September 8th, 2004 04:24 PM





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