Esempio n. 1
0
 /// <summary>
 /// ���캯����
 /// </summary>
 public TextBoxEx()
     : base()
 {
     this.CompareValid = new CompareValidatorEx();
     this.RequiredValid = new RequiredFieldValidatorEx();
     this.RegularValid = new RegularExpressionValidatorEx();
     this.RangeValid = new RangeValidatorEx();
 }
Esempio n. 2
0
        /// <summary>
        /// ���ء�
        /// </summary>
        protected override void CreateChildControls()
        {
            this.EnsureChildControls();

            base.CreateChildControls ();
            //����
            this.RequiredValid = new RequiredFieldValidatorEx();
            this.RequiredValid.EnableClientScript = this.EnableClientScript;
            this.RequiredValid.ControlToValidate = this.ID;
            this.RequiredValid.ErrorMessage = this.RequiredErrorMessage;
            this.RequiredValid.InitialValue = string.Empty;
            this.Controls.Add(this.RequiredValid);
            //��ָ����Χ��
            this.RangeValid = new RangeValidatorEx();
            this.RangeValid.EnableClientScript = this.EnableClientScript;
            this.RangeValid.ControlToValidate = this.ID;
            this.RangeValid.ErrorMessage = this.RangeErrorMessage;
            this.RangeValid.MinimumValue = this.MinValue;
            this.RangeValid.MaximumValue = this.MaxValue;
            this.Controls.Add(this.RangeValid);
            //��ָ���ؼ���ֵ�Ƚ�
            this.CompareValid = new CompareValidatorEx();
            this.CompareValid.EnableClientScript = this.EnableClientScript;
            this.CompareValid.ControlToValidate = this.ID;
            this.CompareValid.ErrorMessage = this.CompareErrorMessage;
            this.CompareValid.ControlToCompare = this.ControlToCompare;
            this.CompareValid.ValueToCompare = this.ValueToCompare;
            this.CompareValid.Operator = this.Operator;
            this.CompareValid.Type = this.Type;
            this.Controls.Add(this.CompareValid);
            //��ָ����������ʽƥ��
            this.RegularValid = new RegularExpressionValidatorEx();
            this.RegularValid.EnableClientScript = this.EnableClientScript;
            this.RegularValid.ControlToValidate = this.ID;
            this.RegularValid.ErrorMessage = this.RegularErrorMessage;
            this.RegularValid.ValidationExpression = this.ValidationExpression;
            this.Controls.Add(this.RegularValid);
        }