Beispiel #1
0
        /// <summary>
        /// Validates the group by running through all the ValidationGroup children
        /// </summary>
        public void Validate()
        {
            foreach (Control ctrl in this.Controls)
            {
                ValidationGroup _validator = ctrl as ValidationGroup;
                if (_validator != null)
                {
                    _validator.Validate();
                    if (!_validator.Validated.Value)
                    {
                        _validated = false;

                        if (_Messages.Count == 0)
                        {
                            _Messages.Add(Resources.Validation.PleaseFix);
                        }

                        foreach (string message in _validator.Messages)
                        {
                            _Messages.Add(message);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Validates the specified validation group
        /// </summary>
        /// <param name="ValidationGroupId">ValidationGroupId</param>
        public void Validate(string ValidationGroupId)
        {
            ValidationGroup _validator = this.FindControlRecursive(ValidationGroupId) as ValidationGroup;

            if (_validator != null)
            {
                _validator.Validate();
                if (!_validator.Validated.Value)
                {
                    _validated = false;

                    if (_Messages.Count == 0)
                    {
                        _Messages.Add(Resources.Validation.PleaseFix);
                    }

                    foreach (string message in _validator.Messages)
                    {
                        _Messages.Add(message);
                    }
                }
            }
        }