ASP.NET CustomValidator
Control
Definition and Usage
The CustomValidator control allows you to write methods to handle input value validation.
Properties
Property | Description |
---|---|
BackColor | The background color of the CustomValidator control. |
ClientValidationFunction | Specifies the name of the client-side script function to be executed. Note: The script must be written in a language supported by the browser, such as VBScript or JScript. When using VBScript, the function must be within the form: Sub FunctionName (source, arguments). When using JScript, the function must be within the form: Function FunctionName (source, arguments). |
ControlToValidate | The ID of the control to be validated. |
Display | The display behavior of the validation control. Legal values are: None - The control does not display. Used only for displaying error messages in the ValidationSummary control.<br> Static - The control displays the error message if validation fails. Space for the message is reserved on the page even if the input passes validation.<br> Dynamic - The control displays the error message if validation fails. Space for the message is dynamically added to the page if the input passes validation. |
EnableClientScript | A Boolean value that specifies whether client-side validation is enabled. |
Enabled | A Boolean value that specifies whether the validation control is enabled. |
ErrorMessage | The text displayed in the ValidationSummary control when validation fails. Note: If the Text property is not set, the text is also displayed in the validation control. |
ForeColor | The foreground color of the control. |
id | The unique ID of the control. |
IsValid | A Boolean value indicating whether the control specified by ControlToValidate passed validation. |
OnServerValidate | Specifies the name of the server-side validation script function to be executed. |
runat | Specifies that the control is a server control. Must be set to "server". |
Text | The message displayed when validation fails. |