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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈