Export (0) Print
Expand All
Expand Minimize

DataSourceCacheExpiry Enumeration

Describes the way data cached using ASP.NET caching mechanisms expires when a time-out is set.

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

public enum class DataSourceCacheExpiry

Member nameDescription
AbsoluteCached data expires when the amount of time specified by the CacheDuration property has passed since the data was first cached.
SlidingCached data expires only when the cache entry has not been used for the amount of time specified by the CacheDuration property.

The DataSourceCacheExpiry enumeration describes how data cached by a data source control expires in the ASP.NET cache. An ASP.NET data source control caches data in the ASP.NET cache based on a specified time-out period, which is set using the CacheDuration property. The DataSourceCacheExpiry describes how this time-out setting is used. If the expiration policy is set to Absolute, the cached data is discarded when the amount of time specified passes since the data was first cached. If the expiration policy is set to Sliding, the cached data is discarded only when the cache entry has not been used for the amount of time specified.

The following code example demonstrates how to use the DataSourceCacheExpiry enumeration declaratively. In this example, a SqlDataSource control is used to display data in a GridView control. The SqlDataSource control has caching enabled and its CacheExpirationPolicy set to Sliding, to cache data as long as there is activity.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2015 Microsoft