473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[CACHE] Remove an Item on exiting application

teo
I have an object stored in the Page.Cache.
(its name is the SessionId number).

I'd like to remove it from the Cache when the user close
or abandons 'mySite.aspx' page
(when he closes the browser, when he jumps to another site,
if the connection is broken, if an Error occur and the user is
istantly redirected to another page ...)

How to detected all this circumstances?

I used the Unload and then the Dispose events of the Page object,
but the first is continuosly fired (at every postback)
and the second is never fired,
so they seem to be both unuseful.
Aug 29 '06 #1
3 1510
KJ
Hello Teo,

You've happened upon a common problem in web application programming
that has no reliable solution. Others may suggest using the Abandon
event of the Session object, but this too has its quirks. Perhaps you
can simply let the object in the Cache expire, or just overwrite it
when appropriate?

teo wrote:
I have an object stored in the Page.Cache.
(its name is the SessionId number).

I'd like to remove it from the Cache when the user close
or abandons 'mySite.aspx' page
(when he closes the browser, when he jumps to another site,
if the connection is broken, if an Error occur and the user is
istantly redirected to another page ...)

How to detected all this circumstances?

I used the Unload and then the Dispose events of the Page object,
but the first is continuosly fired (at every postback)
and the second is never fired,
so they seem to be both unuseful.
Aug 30 '06 #2
teo
Mmmmh... what are the quirks about the
the Abandon event of the Session object ?
>Hello Teo,

You've happened upon a common problem in web application programming
that has no reliable solution. Others may suggest using the Abandon
event of the Session object, but this too has its quirks. Perhaps you
can simply let the object in the Cache expire, or just overwrite it
when appropriate?

teo wrote:
>I have an object stored in the Page.Cache.
(its name is the SessionId number).

I'd like to remove it from the Cache when the user close
or abandons 'mySite.aspx' page
(when he closes the browser, when he jumps to another site,
if the connection is broken, if an Error occur and the user is
istantly redirected to another page ...)

How to detected all this circumstances?

I used the Unload and then the Dispose events of the Page object,
but the first is continuosly fired (at every postback)
and the second is never fired,
so they seem to be both unuseful.
Aug 30 '06 #3
KJ
Sorry Teo, I meant to refer to the Session OnEnd event (not the Abandon
method). You can handle this event, but only once the session times
out. The server cannot know what the user does after the content has
been served (especially re the closing of browser windows). All the
server knows is when the last request was made from a client with a
particular session id.

teo wrote:
Mmmmh... what are the quirks about the
the Abandon event of the Session object ?
Hello Teo,

You've happened upon a common problem in web application programming
that has no reliable solution. Others may suggest using the Abandon
event of the Session object, but this too has its quirks. Perhaps you
can simply let the object in the Cache expire, or just overwrite it
when appropriate?

teo wrote:
I have an object stored in the Page.Cache.
(its name is the SessionId number).

I'd like to remove it from the Cache when the user close
or abandons 'mySite.aspx' page
(when he closes the browser, when he jumps to another site,
if the connection is broken, if an Error occur and the user is
istantly redirected to another page ...)

How to detected all this circumstances?

I used the Unload and then the Dispose events of the Page object,
but the first is continuosly fired (at every postback)
and the second is never fired,
so they seem to be both unuseful.
Aug 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stanley | last post by:
has anyone managed to use cache application block in a web application? thanks stanley
1
by: Glenn | last post by:
Hi, I have a config XML file that I am using from the application cache. I have configured the entry with a remove callback to re-populate cache automatically when the XML file changes. All is...
5
by: Daniel Walzenbach | last post by:
Hi, I need to cache infrequently changed data used by the entire application. Does anybody know whether using Application state (Application = somevalue;) or the Cache API (Cache.Insert) is...
3
by: Jon | last post by:
I have a couple of tables I want to load into a dataset and keep around pretty much forever, although they will need to be refreshed every so often. I can either put the dataset into an...
2
by: Stuart | last post by:
Hi there I am using the following to take an account number from a datagrid in to another page and use it to load specific details according to the account number: Public Sub...
4
by: PenguinPig | last post by:
I have googling some page, and it hasn't mention the resource usage of the server in Application class and Cache class, which one consume more server resource? Thanks
3
by: poolieweb | last post by:
I have created a custom user control which creates a ASPxMenu ( Same fucntion as standard menu control) from data retreved from a webservice (Reporting Services) which deals with user access. This...
3
by: David Lozzi | last post by:
That's really not the question. The question is how do I clear all cache programatically? For example, I want to implement cacheing on some data driven pages however after the employees update the...
2
by: Peter | last post by:
Hi The documentation for System.Web.Caching.Cache states that it is "thread safe". Does this mean that if I access System.Web.Caching.Cache from several places in my application access to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.