asp.net.ph

HttpCachePolicy.SetExpires Method

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
);

Parameters

date
The absolute DateTime value to set the Expires header to.

Remarks

This method will fail if the expiration date violates the principle of restrictiveness.

Example

The following example sets a cache expiration of 300 seconds from the time the page initially loads.

Response.Cache.SetExpires ( DateTime.Now.AddSeconds ( 300 ) );
  C# VB

See Also

HttpCachePolicy Members   Caching ASP.NET Pages Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note