hth wrote:
Hi
I usually check the key and value in my cache with following code:
foreach (DictionaryEntry objItem in Cache)
{
lblCache.Text += "<li>" + objItem.Key;
lblCache.Text += "=" + objItem.Value.ToString();
}
but if I change my web.config file and save it, the code above that
had give me expecting result, give me noting.
Does someone know why this is happening and if there is a way around
it?
Helgi
When you change web.config, the application is restarted.
That's why the Cache (and Application and Session) is empty.
There is no way around it, except to use a database (or file)
to store those items, but that's not how tou want to use a cache.
Especially with Cache it's best to accept that values may be missing:
try if it's there. If so, fine. If not, (re)create that value (or object)
and store it for the next time.
Hans Kesting