asp.net.ph

Response.AppendHeader Method

System.Web Namespace   HttpResponse Class


Adds an HTTP header to the output stream.

[ VB ]
Public Sub AppendHeader ( _
   ByVal name As String, _
   ByVal value As String _
)

[ C# ]
public void AppendHeader (
   string name,
   string value
);

[ C++ ]
public: void AppendHeader (
   String* name,
   String* value
);

[ JScript ]
public function AppendHeader (
   name : String,
   value : String
);

Parameters

name
The name of the HTTP header to add to the output stream.
value
The string to append to the header.

Exceptions


Exception Type Condition
HttpException Occurs when the header is appended after the HTTP headers have been sent.

Remarks

If you use the AppendHeader method to send cache-specific headers and at the same time use the cache object model ( Cache ) to set cache policy, HTTP response headers pertaining to caching ( Cache-Control, Expires, Last-Modified, Pragma, and Vary ) might be deleted when the cache object model is used.

This behavior enables ASP.NET to maintain the most restrictive settings. For example, consider a page that includes user controls. If those controls have conflicting cache policies, the most restrictive cache policy will be used. If one user control sets the header Cache-Control: Public and another sets the more restrictive header Cache-Control: Private via calls to SetCacheability, then the Cache-Control: Private header will be sent with the response.

See Also

HttpResponse Members 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