IValidator Interface
Defines the properties and methods that objects that participate in Web Forms validation must implement.
Assembly: System.Web (in System.Web.dll)
| 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. |
| Name | Description | |
|---|---|---|
![]() | Validate() | When implemented by a class, evaluates the condition it checks and updates the IsValid property. |
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. |
Available since 1.1


