System.Web.UI.WebControls Namespace CustomValidator Class
Sets or retrieves the custom client script function used for validation.
Inline |
<asp:customvalidator clientvalidationfunction = strScriptName ... > |
Script |
CustomValidator.ClientValidationFunction = strScriptName |
strScriptName |
String specifying the name of the custom client script used for validation. |
The property is read/write with no default value.
Set this property to the name of the function that performs the client-side validation.
Because the client validation function runs on the target browser, the function must be written using a scripting language supported by the browser, such as JScript or VBScript.
The following example demonstrates how to use the ClientValidationFunction property to specify the name of the function that performs client-side validation. The validation function checks for even numbers.
<asp:customvalidator id = "CustomValidator1" runat = "server"
controltovalidate = "myTextBox"
clientvalidationfunction = "ClientValidate"
onServerValidate = "ServerValidate"
display = "Static" />
Show me
CustomValidator Members Validating with a Custom Function