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. 3 1510
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.
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.
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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Stanley |
last post by:
has anyone managed to use cache application block in a web application?
thanks
stanley
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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,...
| |