Response. Append Header(String, String) Method
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.
Adds an HTTP header to the output stream.
public: void AppendHeader(System::String ^ name, System::String ^ value);
public void AppendHeader (string name, string value);
member this.AppendHeader : string * string -> unit
Public Sub AppendHeader (name As String, value As String)
The name of the HTTP header to add to the output stream.
The string to append to the header.
The header is appended after the HTTP headers have been sent.
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 that pertain to caching (
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 SetCacheability, then the "
Cache-Control: Private" header will be sent with the response.
For a list of standard HTTP/1.1 headers, see Header field definitions.