CacheItemRemovedReason Enumeration
Specifies the reason an item was removed from the Cache.
Assembly: System.Web (in System.Web.dll)
| Member name | Description | |
|---|---|---|
| Removed | The item is removed from the cache by a Remove method call or by an Insert method call that specified the same key. | |
| Expired | The item is removed from the cache because it expired. | |
| Underused | The item is removed from the cache because the system removed it to free memory. | |
| DependencyChanged | The item is removed from the cache because the cache dependency associated with it changed. |
This enumeration is used by the CacheItemRemovedCallback delegate to notify your ASP.NET applications when and why an object was removed from the Cache.
| Topic | Location |
|---|---|
| How to: Notify an Application When an Item Is Removed from the Cache | Building ASP .NET Web Applications |
| How to: Notify an Application When an Item Is Removed from the Cache | Building ASP .NET Web Applications |
The following code example demonstrates a shared Boolean property, itemRemoved, a shared CacheItemRemovedReason enumeration object, reason, and a CacheItemRemovedCallback delegate, onRemove. The latter can be included in an Insert or Add method call. It also defines a method, RemovedCallback, with a signature that matches the CacheItemRemovedCallback delegate. When the RemovedCallback method is called, it changes the itemRemoved property value to true and assigns the reason property value to the reason provided by the CacheItemRemovedReason enumeration.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.