Export (0) Print
Expand All

XmlDataSource.CacheKeyDependency Property

Gets or sets a user-defined key dependency that is linked to all data cache objects created by the data source control. All cache objects explicitly expire when the key expires.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

'Declaration
Public Overridable Property CacheKeyDependency As String
<asp:XmlDataSource CacheKeyDependency="String" />

Property Value

Type: System.String
A key that identifies all cache objects created by the XmlDataSource control.

The XmlDataSource control supports data caching. While data is cached, the XmlDataSource retrieves data from the cache rather than from the underlying data file. When the cache expires, it retrieves data from the underlying file and re-caches the data.

You can set the CacheKeyDependency property to create a dependency between all cache entries created by the XmlDataSource control and the key. You can programmatically invalidate all the cache entries at any time by expiring the key.

Because of the properties used to create the CacheKeyDependency, it is possible that multiple XmlDataSource controls can use the same cache in scenarios where they load the same data from the same XML file and transform file and have the same CacheDuration and CacheExpirationPolicy set.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft