System.Web Namespace HttpCachePolicy Class
Sets the Expires HTTP header to an absolute date and time.
[ VB ]
Public Sub SetExpires ( _
ByVal date As DateTime _
)
[ C# ]
public void SetExpires (
DateTime date
);
[ C++ ]
public: void SetExpires (
DateTime date
);
[ JScript ]
public function SetExpires (
date : DateTime
);
- date
- The absolute DateTime value to set the Expires header to.
This method will fail if the expiration date violates the principle of restrictiveness.
The following example sets a cache expiration of 300 seconds from the time the page initially loads.
Response.Cache.SetExpires ( DateTime.Now.AddSeconds ( 300 ) );
Response.Cache.SetExpires ( DateTime.Now.AddSeconds ( 300 ) ) |
|
C# |
VB |
HttpCachePolicy Members Caching ASP.NET Pages