Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 September 3rd, 2004, 12:59 AM
Authorized User
 
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete files on closing browser


Help needed!

I have hacked brains on this problem. No use!
I have written code to delete all temporary
data(from sql tables) and files created in the
current session. This works fine on session
timeout and logout. But it does not work if the
user closes the browser directly.

I tried onunload and onbeforeunload. Does not
work.

Any workarounds for this???

Thanks in advance.

:)Spacy







 
Old September 3rd, 2004, 10:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Well No easy way. There's no way for the server to know the client closed the window- that is unless you write some kind of client program to embed in the browser- like active X... which I don't recommend.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old September 3rd, 2004, 04:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Write your own custom session...

Brian
 
Old September 5th, 2004, 11:57 PM
Authorized User
 
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for thr replies.

How do i create a custom session? Is there no way
out at all for this problem???




 
Old September 7th, 2004, 09:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

As I said, you can't do it. There is no way for the Server to know that the browser has closed without writing a custom program on the client. If your in a contolled enviornment (EG: Only IE 5.5 or better on company equipment) you could write something like that- if your dealing with the internet, forget about it.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old September 7th, 2004, 02:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Are you using SQL Server? The only thing I can think of it store some session information in a database (specifically the Session ID), then run a process (such as DTS) that runs over night, and removes some of the data based on Sessions created the previous day. Could be complications with users early in the morning...

Brian
 
Old September 8th, 2004, 05:28 AM
Authorized User
 
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks all!

I guess i will have 2 go with what bmains has written.
Yes am using session id in all my sql tables.
Thanks buddy!



 
Old September 8th, 2004, 04:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You're welcome. Good luck.





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
Closing browser using a Button MichaelTJ ASP.NET 1.0 and 1.1 Basics 3 December 18th, 2003 02:06 PM





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