Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
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 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 February 5th, 2007, 02:44 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Another thing:

It isn't clear from the discussion so far is you want to CLOSE the browser, or return the user back to the page they were on before they got to your site. It sounds to me that you mean the latter.

You could store the ReferrerURL when a user first hits your application. Then your "close" functionality could just redirect them back to where they were. This wouldn't provide a complete "rewind" like behavior, but it's as close as you're likely to get.

Old February 7th, 2007, 03:22 PM
Friend of Wrox
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts


Thanks for the suggestion. I tried it, but it didn't work.
That is, the window requesting the user to confirm shutting down the app still

I'm using(MS VS 2005 Enterprise, ASP.NET 2.0) and IE7.
An interesting note on the javascript function is:

I put a break point while in a debugging environment on the first line in the java
script function "self.opener=self". Single stepping on the second line caused the confirmation window to appear. This leads me to believe that the .close() method calls for the window to appear in spite of trying to trick it in believing the opener is itself.

Here's the relevent code. Maybe there is something else that needs to be done to trick it?

function selfclose()

<input id="btnExitWebsite" type="button" value="Exit Website" onclick="selfclose()"/>


Old February 7th, 2007, 03:39 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

The self.opener=self trick only worked on IE 6 and earlier.

The loophole, closing the browser without user's consent, was closed in IE 7.

Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Old February 7th, 2007, 03:43 PM
Friend of Wrox
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks Imar.

Similar Threads
Thread Thread Starter Forum Replies Last Post
using asp.net web user control in asp 3.0 App i_shahid Classic ASP Professional 0 January 8th, 2008 07:32 AM
Turning a regular ASP.NET App into an AJAX ASP.Net donrafeal7 Ajax 2 August 31st, 2007 12:33 AM
post xml data from ASP.NET app to ASP app polekat Classic ASP Professional 2 January 31st, 2007 08:44 AM
System stop responding when I compile web app aremskar VB.NET 2002/2003 Basics 0 February 15th, 2005 09:39 AM
Porting a sa,ple ASP CR viewer app to ASP.NET jhansen42 Crystal Reports 0 August 29th, 2003 10:26 AM

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