The text of this article is not in this database — only its details are. Read it on the old site: CacheItemRemovedCallback in ASP.NET
7 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: CacheItemRemovedCallback in ASP.NET
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Amit PatelPosted Jul 3, 2012, 11:04 AM
Thanks Ed..
EdPosted Jul 3, 2012, 10:17 AM
This slight code change will show that the callback is being called without being in debug mode. static string removedMessage = string.Empty; public void RemovedCallback(String k, Object v, CacheItemRemovedReason r) { removedMessage = string.Format("Cache has been removed: {0}",k ); } protected void btnAddToCache_Click(object sender, EventArgs e) { ... Same as above } protected void btnRemoveFromCache_Click(object sender, EventArgs e) { if (Cache["Key1"] != null) Cache.Remove("Key1"); lblStatus.Text = removedMessage; }
Amit PatelPosted Jul 3, 2012, 2:49 AM
@Nitin, Defines a callback method for notifying applications when a cached item is removed from the Cache.
Amit PatelPosted Jul 3, 2012, 2:48 AM
@Gaurav, This enumeration is used by the CacheItemRemovedCallback delegate to notify your ASP.NET applications when and why an object was removed from the Cache.
nitin bhardwajPosted Jul 3, 2012, 1:27 AM
what is the mean of cacheitemremovedcallback?
Gaurav GuptaPosted Jul 3, 2012, 12:52 AM
Hi, What is CacheItemRemoveReason parameter in the method?
Gaurav GuptaPosted Jul 3, 2012, 12:52 AM
Hi, What is CacheItemRemoveReason parameter in the method?