Defines a callback method for notifying applications before a cached item is removed from the cache.
Public Delegate Sub CacheItemUpdateCallback ( _ key As String, _ reason As CacheItemUpdateReason, _ <OutAttribute> ByRef expensiveObject As Object, _ <OutAttribute> ByRef dependency As CacheDependency, _ <OutAttribute> ByRef absoluteExpiration As DateTime, _ <OutAttribute> ByRef slidingExpiration As TimeSpan _ )
Dim instance As New CacheItemUpdateCallback(AddressOf HandlerMethod)
public delegate void CacheItemUpdateCallback( string key, CacheItemUpdateReason reason, out Object expensiveObject, out CacheDependency dependency, out DateTime absoluteExpiration, out TimeSpan slidingExpiration )
public delegate void CacheItemUpdateCallback( String^ key, CacheItemUpdateReason reason, [OutAttribute] Object^% expensiveObject, [OutAttribute] CacheDependency^% dependency, [OutAttribute] DateTime% absoluteExpiration, [OutAttribute] TimeSpan% slidingExpiration )
JScript does not support delegates.
When an object expires in the cache, ASP.NET calls the CacheItemUpdateCallback method with the key for the cache item and the reason you might want to update the item. The remaining parameters of this method are out parameters. You supply the new cached item and optional expiration and dependency values to use when refreshing the cached item.
The update callback is not called if the cached item is explicitly removed by using a call to Remove()()().
If you want the cached item to be removed from the cache, you must return nullNothingnullptra null reference (Nothing in Visual Basic) in the expensiveObject parameter. Otherwise, you return a reference to the new cached data by using the expensiveObject parameter. If you do not specify expiration or dependency values, the item will be removed from the cache only when memory is needed.
If the callback method throws an exception, ASP.NET suppresses the exception and removes the cached value.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003