Validation Controls[5]->CustomValidator
The CustomValidator control calls a user-defined function to perform validations that the standard validators can't handle. The custom function can execute on the server or in client-side script, such as JScript or VBScript. For client-side custom validation, the name of the custom function must be identified in the ClientValidationFunction property. The custom function must have the form
For server-side custom validation, place your custom validation in the validator's OnServerValidate delegate.
The following sample illustrates using the CustomValidator control.
For a detailed discussion of Web Forms validation, please see the Validating Form Input Controls section of this QuickStart tutorial.
function myvalidator(source, arguments) Note that source is the client-side CustomValidator object, and arguments is an object with two properties, Value and IsValid. The Value property is the value to be validated and the IsValid property is a Boolean used to set the return result of the validation. You can view a client-side validation example in the Validating Form Input Controls section. For server-side custom validation, place your custom validation in the validator's OnServerValidate delegate.
The following sample illustrates using the CustomValidator control.
For a detailed discussion of Web Forms validation, please see the Validating Form Input Controls section of this QuickStart tutorial.


浙公网安备 33010602011771号