//这个函数是asp.net验证控件内置js脚本中的一个函数，将其改写，
//当验证未通过时，将控件高亮显示。
//包含该代码js脚本文件一定要放到页面的底部，这样可以覆盖asp.net
//自带的js文件中的该函数。
function ValidatorValidate(val, validationGroup, event) {
    val.isvalid = true;
    if ((typeof (val.enabled) == "undefined" || val.enabled != false) && IsValidationGroupMatch(val, validationGroup)) {
        if (typeof (val.evaluationfunction) == "function") {
            val.isvalid = val.evaluationfunction(val);

            //added by czh 20080709=============================
            var $controltovalidate = $(document.getElementById(val.controltovalidate));
            if (!val.isvalid) {
                //alert("1:" + val.controltovalidate);
                if (!$controltovalidate.hasClass("error_indicator")) {
                    $controltovalidate.addClass("error_indicator");
                }
            } else {
                if (val.evaluationfunction == RequiredFieldValidatorEvaluateIsValid) {
                    //alert("2:" + val.controltovalidate);
                    $controltovalidate.removeClass("error_indicator");
                }
            }
            //added by czh 20150709.END=============================

            if (!val.isvalid && Page_InvalidControlToBeFocused == null &&
                typeof (val.focusOnError) == "string" && val.focusOnError == "t") {
                ValidatorSetFocus(val, event);
            }
        }
    }
    ValidatorUpdateDisplay(val);
}