System.Web.HttpResponse.AppendHeader Method

Adds an HTTP header to the output stream.

Syntax

public void AppendHeader (string name, string value)

Parameters

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

Remarks

If you use the HttpResponse.AppendHeader(string, string) method to send cache-specific headers and at the same time use the cache object model (HttpResponse.Cache) to set cache policy, HTTP response headers that pertain 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 user control sets the more restrictive header "Cache-Control: Private" via calls to HttpCachePolicy.SetCacheability(HttpCacheability), then the "Cache-Control: Private" header will be sent with the response.

For a list of standard HTTP/1.1 headers, see section 14, "Header Field Definitions," in the tp://go.microsoft.com/fwlink/?LinkID=73147 specification on the World Wide Web Consortium (W3C) Web site.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0