This article transferred from: http://tech.cncms.com/web/aspnet/96310.html
CustomValidator validation controls allow you to customize validation functions and implement validation rules that are not implemented by several other validation controls, the simplest of which is as follows:
<%@ page language= "C #" autoeventwireup= "true" codefile= "CustomValidatorDemo.aspx.cs" inherits= " Customvalidatordemo "%><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">1, function name by clientvalidationfunction= "IsEven" designation, function parameter name can decide, for example, some instances of the args written in arguments, is also possible;
2, the formal parameter args has two properties of args. Value and Arg.isvalid, these two attributes should be case-sensitive
3. Custom validation controls can trigger OnServerValidate events, and validation code can be written on the server side, but if you do, you lose the sense that validation controls are validated on the client side.