asp.net.ph

HttpCachePolicy.SetETag Method

System.Web Namespace   HttpCachePolicy Class


Sets the ETag HTTP header to the specified string.

[ VB ]
Public Sub SetETag ( _
   ByVal etag As String _
)

[ C# ]
public void SetETag (
   string etag
);

[ C++ ]
public: void SetETag (
   String* etag
);

[ JScript ]
public function SetETag (
   etag : String
);

Parameters

etag
The text to use for the ETag header.

Exceptions


Exception Type Condition
ArgumentNullException Occurs when etag is a null reference ( Nothing in Visual Basic ).
InvalidOperationException Occurs when the ETag header has already been set.
InvalidOperationException Occurs when SetETagFromFileDependencies has already been called.

Remarks

The ETag header is a unique identifier for a specific version of a document. Once an ETag header is set, subsequent attempts to set it will fail and an exception will be thrown.

Example

The following example sets the ETag header to a custom value.

[ VB ]
Response.Cache.SetETag ( "50f59e42f4d8bc1:cd7" )

[ C# ]
Response.Cache.SetETag ( "50f59e42f4d8bc1:cd7" );

[ JScript ] 
Response.Cache.SetETag ( "50f59e42f4d8bc1:cd7" )
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