HttpResponse::AddCacheItemDependency Method (String^)
Makes the validity of a cached response dependent on another item in the cache.
Assembly: System.Web (in System.Web.dll)
When the item corresponding to the cacheKey parameter is removed from the cache, the cached response of the current item is invalid.
The following example is an ASP.NET user control that is output cached. The code for the control calls the Cache object passed as its parameter. If the item does not exist in the cache, the control's response that was stored in the output cache is invalidated. This means that on the subsequent request, a new version of the control's response will be added to the output cache.method with the key of an item stored in the
Next, the code checks whether an item associated with a bookData key is stored in the Cache object, and displays one of two lines of text dependent upon the result. Then, the code sets the DataSource property of a DataGrid control, which is named dgBooks, with a call to a custom DataHelper class' shared GetBookData method, and populates the DataGrid with the DataBind method.
Available since 1.1