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)
Visual Basic (Declaration)
Public Shared ReadOnly NoSlidingExpiration As TimeSpan
Dim value As TimeSpan
value = Cache.NoSlidingExpiration
public static readonly TimeSpan NoSlidingExpiration
public:
static initonly TimeSpan NoSlidingExpiration
public static final TimeSpan NoSlidingExpiration
public static final var NoSlidingExpiration : 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, Nothing, DateTime.Now.AddMinutes(2), System.Web.Caching.Cache.NoSlidingExpiration)
Cache.Insert("DSN", connectionString, null, DateTime.Now.AddMinutes(2), System.Web.Caching.Cache.NoSlidingExpiration);
get_Cache().Insert("DSN", connectionString, null,
DateTime.get_Now().AddMinutes(2),
System.Web.Caching.Cache.NoSlidingExpiration);
Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
.NET Framework
Supported in: 3.0, 2.0, 1.1, 1.0