NoSlidingExpiration Field
Collapse the table of content
Expand the table of content

Cache.NoSlidingExpiration Field

 

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)

public static readonly TimeSpan NoSlidingExpiration

Field Value

Type: System.TimeSpan

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.

The following example demonstrates how to use the Insert method to add an item to the Cache object using the NoSlidingExpiration field.

Cache.Insert("DSN", connectionString, null, DateTime.Now.AddMinutes(2), System.Web.Caching.Cache.NoSlidingExpiration);

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft