Cache.NoSlidingExpiration Field
.NET Framework 3.0
Used as the slidingExpiration parameter in an Insert or Add method call to disable sliding expirations. This field is read-only.
Namespace: System.Web.Caching
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
When used, this field sets the slidingExpiration parameter to the TimeSpan.Zero field, which has a constant value of zero. The cached item expires in accordance with the absoluteExpiration parameter associated with the Insert or Add method call.
| Topic | Location |
|---|---|
| How to: Add Items to the Cache | Building ASP .NET Web Applications |
| How to: Add Items to the Cache | Building ASP .NET Web Applications |
The following example demonstrates how to use the Insert method to add an item to the Cache object using the NoSlidingExpiration field.
get_Cache().Insert("DSN", connectionString, null,
DateTime.get_Now().AddMinutes(2),
System.Web.Caching.Cache.NoSlidingExpiration);
Community Additions
ADD
Show: