Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 1.1
.NET Framework
Reference
Class Library
System.Web
HttpResponse Class
Methods
 AddHeader Method
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Class Library
HttpResponse.AddHeader Method

Adds an HTTP header to the output stream.

AddHeader is provided for compatibility with previous versions of ASP.

[Visual Basic]
Public Sub AddHeader( _
   ByVal name As String, _
   ByVal value As String _
)
[C#]
public void AddHeader(
 string name,
 string value
);
[C++]
public: void AddHeader(
 String* name,
 String* value
);
[JScript]
public function AddHeader(
   name : String,
 value : String
);

Parameters

name
The name of the HTTP header to add value to.
value
The string to add to the header.

Remarks

AddHeader is the same as AppendHeader and is provided only for compatibility with previous versions of ASP. With ASP.NET, use AppendHeader.

Example

[Visual Basic] 
Response.Addheader("CustomHeader", "xxxx")
    

[C#] 
Response.AddHeader("CustomHeader", "xxxx");
    

[C++] 
Response->AddHeader(S"CustomHeader", S"xxxx");
    

[JScript] 
Response.AddHeader("CustomHeader", "xxxx")
    

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpResponse Class | HttpResponse Members | System.Web Namespace

© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker