IValidator Interface
Defines the properties and methods that objects that participate in Web Forms validation must implement.
Assembly: System.Web (in System.Web.dll)
The IValidator type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ErrorMessage | When implemented by a class, gets or sets the error message text generated when the condition being validated fails. |
![]() | IsValid | When implemented by a class, gets or sets a value indicating whether the user-entered content in the specified control passes validation. |
Classes that implement this interface represent a possible user input error. When the Validate method is called, the class updates its IsValid property to signify whether the error occurred. The ErrorMessage property contains a text description of the error condition that you can display when the error occurs.
The BaseValidator class implements this interface, and all other ASP.NET validation server control classes inherit from BaseValidator. For information on validation server controls and how they work, see ASP.NET Validation Controls.
For details on how to develop custom ASP.NET validation server controls, see How to: Validate with a Custom Function for ASP.NET Server Controls.
Security Note |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


Security Note