Export (0) Print
Expand All

WebHeaderCollection.AddWithoutValidate Method

Inserts a header into the collection without checking whether the header is on the restricted header list.

[Visual Basic]
Protected Sub AddWithoutValidate( _
   ByVal headerName As String, _
   ByVal headerValue As String _
)
[C#]
protected void AddWithoutValidate(
 string headerName,
 string headerValue
);
[C++]
protected: void AddWithoutValidate(
 String* headerName,
 String* headerValue
);
[JScript]
protected function AddWithoutValidate(
   headerName : String,
 headerValue : String
);

Parameters

headerName
The header to add to the collection.
headerValue
The content of the header.

Exceptions

Exception Type Condition
ArgumentException headerName is a null reference (Nothing in Visual Basic), Empty, or contains invalid characters.

-or-

headerValue contains invalid characters.

Remarks

The AddWithoutValidate method adds a header to the collection without checking whether the header is on the restricted header list.

Notes to Inheritors:  Use the AddWithoutValidate method to add headers that are normally exposed through properties.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

WebHeaderCollection Class | WebHeaderCollection Members | System.Net Namespace

Show:
© 2014 Microsoft