This documentation is archived and is not being maintained.

HttpRequest.ValidateInput Method

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Validates data submitted by a client browser and raises an exception if potentially dangerous data is present.

[Visual Basic]
Public Sub ValidateInput()
public void ValidateInput();
public: void ValidateInput();
public function ValidateInput();


Exception Type Condition
HttpRequestValidationException Potentially dangerous data was received from the client.


If the validation feature is enabled by page directive or configuration, this method is called during the Page's ProcessRequest processing phase. ValidateInput can be called by your code if the validation feature is not enabled. Request validation works by checking all input data against a hard-coded list of potentially dangerous data.

QueryString, Form, and Cookies input data is checked during request validation.


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

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace