Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. 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 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
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 27th, 2005, 03:59 PM
Registered User
Join Date: Jun 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP script runs when page closes

I have an app that needs to run an ASP script contained on that page when the page is closed. I have something similar to this working now by calling another ASP page using the body OnBeforeUnLoad event.

Can this be accomplished in the same ASP page?. I think I've seen examples of calling ASP scripts from events, but I can't remember where. The script has to run when the page closes -hence the OnBeforeUnLoad event.

Any ideas?

Reply With Quote
  #2 (permalink)  
Old January 12th, 2006, 10:46 PM
Authorized User
Join Date: Jul 2004
Location: Barrie, Ontario, Canada.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts

You may wish to look at using Global.asa and the Session_OnEnd(). You will have to create a session for your visitor and then use Session.Abandon when you want the code block to run. This method will also run the code block if the user's session times out normally. Off hand I know of no other way; mainly due to the fact that any server-side code has already been executed and the page is now 100% client-side. Your use of javascript or other client-side code is the only other way I can see a solution.
Reply With Quote

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
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
ASP WebMatrix closes unexpectedly asp_princess ASP.NET 1.0 and 1.1 Basics 0 June 28th, 2007 09:36 AM
Calling a HTML page from an ASP script Brutus Buckeye ASP.NET 1.0 and 1.1 Basics 1 November 2nd, 2005 03:56 PM
Google Adsense for Search script in asp.net page claudew BOOK: ASP.NET Website Programming Problem-Design-Solution 6 September 20th, 2004 08:59 PM
Query runs in SQL Server but not in ASP Ron Howerton ASP.NET 1.0 and 1.1 Basics 2 July 14th, 2003 04:33 PM

All times are GMT -4. The time now is 11:59 PM.

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