Ejemplo n.º 1
0
        /// <summary>
        /// Perform Custom Validation on specific control.
        /// </summary>
        /// <param name="ctrl"></param>
        /// <returns></returns>
        private ValidationRule CustomValidate(Control ctrl)
        {
            ValidationRule vr = _ValidationRules[ctrl] as ValidationRule;

            if (vr != null)
            {
                CustomValidationEventArgs e = new CustomValidationEventArgs(ctrl.Text, vr);
                vr.OnCustomValidationMethod(e);
            }
            return(vr);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Perform Custom Validation on specific control.
        /// </summary>
        /// <param name="ctrl"></param>
        /// <returns></returns>
        private ValidationRule CustomValidate(Control ctrl)
        {
            ValidationRule vr = _ValidationRules[ctrl] as ValidationRule;

            if (vr != null)
            {
                CustomValidationEventArgs e = new CustomValidationEventArgs(ctrl.Text, vr);
                vr.OnCustomValidationMethod(e);
                //add by rad 2011/8/22
                vr.IsCustomError = !vr.IsValid;
            }
            return(vr);
        }