asp.net.ph

HttpCachePolicy.SetLastModified Method

System.Web Namespace   HttpCachePolicy Class


Sets the Last-Modified HTTP header to the DateTime value supplied.

[ VB ]
Public Sub SetLastModified ( _
   ByVal date As DateTime _
)

[ C# ]
public void SetLastModified (
   DateTime date
);

[ C++ ]
public: void SetLastModified (
   DateTime date
);

[ JScript ]
public function SetLastModified (
   date : DateTime
);

Parameters

date
The new DateTime value for the Last-Modified header.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException Occurs when date is earlier than the current DateTime.

Remarks

The Last-Modified HTTP header time stamps the document with the DateTime value indicating when the document was last modified.

This method will fail if the caching restrictiveness hierarchy is violated.

Example

[ VB, JScript ] The following example sets the Last-Modified header to a new date.

[ VB ]
Response.Cache.SetLastModified ( DateTime.Parse ( "1/1/2001 00:00:01AM" ) )

[ JScript ] 
Response.Cache.SetLastModified ( DateTime.Parse ( "1/1/2001 00:00:01AM" ) )

[ C#, C++ ] No example is available for C# or C++. To view a Visual Basic or JScript example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

HttpCachePolicy Members   Caching ASP.NET Pages Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph