HttpCachePolicy.SetLastModified(DateTime) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the Last-Modified
HTTP header to the DateTime value supplied.
public:
void SetLastModified(DateTime date);
public void SetLastModified (DateTime date);
member this.SetLastModified : DateTime -> unit
Public Sub SetLastModified (date As DateTime)
Parameters
Exceptions
date
is later than the current DateTime
.
Examples
The following code example demonstrates how to set the Last-Modified
header to a new date.
Response.Cache.SetLastModified(DateTime.Parse("1/1/2001 00:00:01AM"));
Response.Cache.SetLastModified(DateTime.Parse("1/1/2001 00:00:01AM"))
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.
SetLastModified is introduced in the .NET Framework version 3.5. For more information, see Versions and Dependencies.
Applies to
.NET