Exemplo n.º 1
0
        private void DisplaySuccess()
        {
            DOMElement validationSummaryElement = _validationSummaryElement;

            if (validationSummaryElement != null)
            {
                DOMElement validationSummaryULElement = _validationSummaryULElement;
                if (validationSummaryULElement != null)
                {
                    // delete all children
                    validationSummaryULElement.InnerHTML = "";
                }

                DomElement.RemoveCssClass(validationSummaryElement, _validationSummaryErrorCss);
                DomElement.AddCssClass(validationSummaryElement, _validationSummaryValidCss);
            }
        }
Exemplo n.º 2
0
        private void DisplayError()
        {
            if (_validationSummaryElement != null)
            {
                if (_validationSummaryULElement != null)
                {
                    // replace all children with the current error list
                    ValidationUtil.RemoveAllChildren(_validationSummaryULElement);
                    for (int i = 0; i < _errors.Length; i++)
                    {
                        DOMElement liElement = Document.CreateElement("li");
                        ValidationUtil.SetInnerText(liElement, (string)_errors[i]);
                        _validationSummaryULElement.AppendChild(liElement);
                    }
                }

                DomElement.RemoveCssClass(_validationSummaryElement, _validationSummaryValidCss);
                DomElement.AddCssClass(_validationSummaryElement, _validationSummaryErrorCss);
            }
        }
Exemplo n.º 3
0
        private void DisplaySuccess()
        {
            DOMElement validationMessageElement = ValidationMessageElement;

            if (validationMessageElement != null)
            {
                if (ReplaceValidationMessageContents)
                {
                    ValidationUtil.SetInnerText(validationMessageElement, "");
                }
                DomElement.RemoveCssClass(validationMessageElement, _validationMessageErrorCss);
                DomElement.AddCssClass(validationMessageElement, _validationMessageValidCss);
            }

            // update actual input elements
            DOMElement[] elements = Elements;
            for (int i = 0; i < elements.Length; i++)
            {
                DOMElement element = elements[i];
                DomElement.RemoveCssClass(element, _inputElementErrorCss);
                DomElement.AddCssClass(element, _inputElementValidCss);
            }
        }