public virtual void Visit(FormTitle formTitle, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formTitle.Path) : new HtmlDiv(); htmlDiv.Class.Add("formTitle"); if (!string.IsNullOrWhiteSpace(formTitle.CssClass)) { htmlDiv.Class.AddRange(formTitle.CssClass.Split(' ').Where(s => s != string.Empty)); } if (!string.IsNullOrWhiteSpace(formTitle.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formTitle.Path)); } htmlDiv.Hidden.Value = formTitle.IsHidden; htmlContainer.Add(htmlDiv); HtmlLabel htmlLabel = new HtmlLabel(verbose ? formTitle.Path : string.Empty); htmlDiv.Add(htmlLabel); htmlLabel.Add(new HtmlText(formTitle.Content)); }
private HtmlLabel GetLabel(FormInput formInput, HtmlElement htmlElement) { HtmlLabel htmlLabel = verbose ? new HtmlLabel(formInput.Path) : new HtmlLabel(); htmlLabel.Class.Add("formInputLabel"); htmlLabel.For.Value = htmlElement.Id.Value; htmlLabel.Add(new HtmlText(formInput.Label)); return(htmlLabel); }
private HtmlLabel CreateCheckBox(FormCheckBox formCheckBox) { HtmlLabel htmlLabel = new HtmlLabel(); htmlLabel.Class.AddRange(new string[] { "switch", "switch-default", "switch-pill", "switch-primary", "ml-2" }); HtmlCheckBox htmlCheckBox = new HtmlCheckBox(formCheckBox.Path); htmlCheckBox.Class.Add("switch-input"); htmlCheckBox.Disabled.Value = formCheckBox.IsDisabled; htmlCheckBox.Checked.Value = formCheckBox.Value; htmlLabel.Add(htmlCheckBox); HtmlSpan htmlSpan = new HtmlSpan(); htmlSpan.Class.Add("switch-label"); htmlLabel.Add(htmlSpan); htmlSpan = new HtmlSpan(); htmlSpan.Class.Add("switch-handle"); htmlLabel.Add(htmlSpan); return(htmlLabel); }
private void AddMark(FormInput formInput, HtmlElement htmlElement, HtmlContainer htmlContainer) { if (!(formInput.IsMarkedRequired || formInput.IsMarkedOptional)) { return; } HtmlLabel htmlLabel = new HtmlLabel(); htmlLabel.Class.Add(GetMarkClass(formInput)); htmlLabel.Add(GetMarkHtmlText(formInput)); htmlLabel.For.Value = htmlElement.Id.Value; htmlContainer.Add(htmlLabel); }
public virtual void Visit(FormRadioButton formRadioButton, HtmlContainer htmlContainer) { HtmlRadioButton htmlRadioButton = new HtmlRadioButton(formRadioButton.FormRadioGroup.Path, formRadioButton.Value); htmlRadioButton.Hidden.Value = formRadioButton.IsHidden; htmlRadioButton.Disabled.Value = formRadioButton.IsDisabled; htmlRadioButton.Value.Value = formRadioButton.Value; htmlRadioButton.Checked.Value = formRadioButton.IsSelected; HtmlLabel htmlLabel = new HtmlLabel(verbose ? string.Format("{0}{1}", formRadioButton.FormRadioGroup.Path, formRadioButton.Value) : ""); htmlLabel.For.Value = htmlRadioButton.Id.Value; htmlLabel.Hidden.Value = formRadioButton.IsHidden; htmlLabel.Add(new HtmlText(formRadioButton.Text)); htmlContainer.Add(htmlRadioButton); htmlContainer.Add(htmlLabel); }
private void AddLabelMark(FormInput formInput, HtmlElement htmlElement, HtmlContainer htmlContainer, bool labelFirst) { if (formInput.IsHidden) { return; } if (string.IsNullOrWhiteSpace(formInput.Label)) { return; } HtmlLabel htmlLabel = GetLabel(formInput, htmlElement); if (!(formInput.IsMarkedRequired || formInput.IsMarkedOptional)) { htmlContainer.Add(htmlLabel); return; } HtmlSpan htmlSpan = new HtmlSpan(); htmlSpan.Class.Add(GetMarkClass(formInput)); htmlSpan.Add(GetMarkHtmlText(formInput)); if (labelFirst) { htmlLabel.Add(htmlSpan); } else { htmlLabel.Insert(0, htmlSpan); } htmlContainer.Add(htmlLabel); }
public virtual void Visit(FormTextBox formTextBox, HtmlContainer htmlContainer) { HtmlFieldset htmlFieldset = verbose ? new HtmlFieldset(formTextBox.Path) : new HtmlFieldset(); htmlFieldset.Class.Add("formTextBox"); if (!string.IsNullOrWhiteSpace(formTextBox.CssClass)) { htmlFieldset.Class.AddRange(formTextBox.CssClass.Split(' ').Where(s => s != string.Empty)); } htmlFieldset.Class.Add("form-group"); if (!string.IsNullOrWhiteSpace(formTextBox.Path)) { htmlFieldset.Class.Add(string.Format("{0}{1}", "formId", formTextBox.Path)); } htmlFieldset.Class.Add("formField"); if (initialize) { htmlFieldset.Class.Add(formTextBox.IsRequired ? "formRequired" : "formOptional"); } else { if (formTextBox.HasValue) { htmlFieldset.Class.Add(formTextBox.IsValid ? "formValid" : "formInvalid"); } else { htmlFieldset.Class.Add(formTextBox.IsRequired ? "formNotEntered" : "formOptional"); } } htmlFieldset.Hidden.Value = formTextBox.IsHidden; htmlContainer.Add(htmlFieldset); HtmlTextBox htmlTextBox = new HtmlTextBox(formTextBox.Path); htmlTextBox.Class.Add("form-control"); htmlTextBox.Disabled.Value = formTextBox.IsDisabled; htmlTextBox.ReadOnly.Value = formTextBox.IsReadOnly; htmlTextBox.Value.Value = formTextBox.Value; string placeholder = null; if (!string.IsNullOrWhiteSpace(formTextBox.Placeholder)) { if (formTextBox.IsRequired && formTextBox.IsRequiredInPlaceholder && !string.IsNullOrWhiteSpace(formTextBox.RequiredMark)) { placeholder = string.Format("{0} {1}", formTextBox.Placeholder, formTextBox.RequiredMark); } else if (!formTextBox.IsRequired && formTextBox.IsOptionalInPlaceholder && !string.IsNullOrWhiteSpace(formTextBox.OptionalMark)) { placeholder = string.Format("{0} {1}", formTextBox.Placeholder, formTextBox.OptionalMark); } else { placeholder = formTextBox.Placeholder; } } htmlTextBox.Placeholder.Value = placeholder; if (!initialize && firstInvalidId == null) { if (formTextBox.IsRequired && !formTextBox.HasValue || !formTextBox.IsValid) { firstInvalidId = htmlTextBox.Id.Value; } } switch (formTextBox.OrderElements) { case OrderElements.LabelMarkInput: AddLabelMark(formTextBox, htmlTextBox, htmlFieldset); htmlFieldset.Add(htmlTextBox); break; case OrderElements.MarkLabelInput: AddMarkLabel(formTextBox, htmlTextBox, htmlFieldset); htmlFieldset.Add(htmlTextBox); break; case OrderElements.InputLabelMark: htmlFieldset.Add(htmlTextBox); AddLabelMark(formTextBox, htmlTextBox, htmlFieldset); break; case OrderElements.InputMarkLabel: htmlFieldset.Add(htmlTextBox); AddMarkLabel(formTextBox, htmlTextBox, htmlFieldset); break; case OrderElements.LabelInputMark: AddLabel(formTextBox, htmlTextBox, htmlFieldset); htmlFieldset.Add(htmlTextBox); AddMark(formTextBox, htmlTextBox, htmlFieldset); break; case OrderElements.MarkInputLabel: AddMark(formTextBox, htmlTextBox, htmlFieldset); htmlFieldset.Add(htmlTextBox); AddLabel(formTextBox, htmlTextBox, htmlFieldset); break; default: case OrderElements.NotSet: break; } if (initialize) { return; } string message = null; if (formTextBox.UseLastMessage) { if (!string.IsNullOrEmpty(formTextBox.LastMessage)) { message = formTextBox.LastMessage; } } else if (formTextBox.IsRequired && !formTextBox.HasValue) { message = formTextBox.RequiredMessage; } else if (!formTextBox.IsValid) { message = formTextBox.ValidationMessage; } if (message == null) { return; } HtmlLabel htmlLabelMessage = new HtmlLabel(verbose ? string.Format("{0}{1}", formTextBox.Path, "Message") : ""); htmlLabelMessage.Class.Add("formValidationMessage"); htmlLabelMessage.For.Value = htmlTextBox.Id.Value; htmlLabelMessage.Add(new HtmlText(message)); htmlFieldset.Add(htmlLabelMessage); }
public virtual void Visit(FormSelect formSelect, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formSelect.Path) : new HtmlDiv(); htmlDiv.Class.Add("formSelect"); if (!string.IsNullOrWhiteSpace(formSelect.CssClass)) { htmlDiv.Class.AddRange(formSelect.CssClass.Split(' ').Where(s => s != string.Empty)); } if (!string.IsNullOrWhiteSpace(formSelect.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formSelect.Path)); } htmlDiv.Class.Add("formField"); if (initialize) { htmlDiv.Class.Add(formSelect.IsRequired ? "formRequired" : "formOptional"); } else { if (!formSelect.IsRequired || formSelect.HasValue) { htmlDiv.Class.Add("formValid"); } else { htmlDiv.Class.Add(formSelect.IsRequired ? "formNotEntered" : "formOptional"); } } htmlDiv.Hidden.Value = formSelect.IsHidden; htmlContainer.Add(htmlDiv); HtmlSelect htmlSelect = formSelect.Size.HasValue ? new HtmlSelect(formSelect.Path, formSelect.Size.Value, formSelect.Update) : new HtmlSelect(formSelect.Path, formSelect.IsMultiSelect, formSelect.Update); htmlSelect.Disabled.Value = formSelect.IsDisabled; if (!initialize && firstInvalidId == null) { if (formSelect.IsRequired && !formSelect.HasValue || !formSelect.IsValid) { firstInvalidId = htmlSelect.Id.Value; } } switch (formSelect.OrderElements) { case OrderElements.LabelMarkInput: AddLabelMark(formSelect, htmlSelect, htmlDiv); htmlDiv.Add(htmlSelect); break; case OrderElements.MarkLabelInput: AddMarkLabel(formSelect, htmlSelect, htmlDiv); htmlDiv.Add(htmlSelect); break; case OrderElements.InputLabelMark: htmlDiv.Add(htmlSelect); AddLabelMark(formSelect, htmlSelect, htmlDiv); break; case OrderElements.InputMarkLabel: htmlDiv.Add(htmlSelect); AddMarkLabel(formSelect, htmlSelect, htmlDiv); break; case OrderElements.LabelInputMark: AddLabel(formSelect, htmlSelect, htmlDiv); htmlDiv.Add(htmlSelect); AddMark(formSelect, htmlSelect, htmlDiv); break; case OrderElements.MarkInputLabel: AddMark(formSelect, htmlSelect, htmlDiv); htmlDiv.Add(htmlSelect); AddLabel(formSelect, htmlSelect, htmlDiv); break; default: case OrderElements.NotSet: break; } foreach (var formOption in formSelect.Content) { Visit(formOption, htmlSelect); } if (initialize) { return; } string message = null; if (formSelect.UseLastMessage) { if (!string.IsNullOrEmpty(formSelect.LastMessage)) { message = formSelect.LastMessage; } } else if (formSelect.IsRequired && !formSelect.HasValue) { message = formSelect.RequiredMessage; } else if (!formSelect.IsValid) { message = formSelect.ValidationMessage; } if (message == null) { return; } HtmlLabel htmlLabelMessage = new HtmlLabel(verbose ? string.Format("{0}{1}", formSelect.Path, "Message") : ""); htmlLabelMessage.Class.Add("formValidationMessage"); htmlLabelMessage.For.Value = htmlSelect.Id.Value; htmlLabelMessage.Add(new HtmlText(message)); htmlDiv.Add(htmlLabelMessage); }
public virtual void Visit(FormDatePicker formDatePicker, HtmlContainer htmlContainer) { HtmlFieldset htmlFieldset = verbose ? new HtmlFieldset(formDatePicker.Path) : new HtmlFieldset(); htmlFieldset.Class.Add("formDatePicker"); if (!string.IsNullOrWhiteSpace(formDatePicker.CssClass)) { htmlFieldset.Class.AddRange(formDatePicker.CssClass.Split(' ').Where(s => s != string.Empty)); } htmlFieldset.Class.Add("form-group"); if (!string.IsNullOrWhiteSpace(formDatePicker.Path)) { htmlFieldset.Class.Add(string.Format("{0}{1}", "formId", formDatePicker.Path)); } htmlFieldset.Class.Add("formField"); if (initialize) { htmlFieldset.Class.Add(formDatePicker.IsRequired ? "formRequired" : "formOptional"); } else { if (!formDatePicker.IsRequired || formDatePicker.HasValue) { htmlFieldset.Class.Add(formDatePicker.IsValid ? "formValid" : "formInvalid"); } else { htmlFieldset.Class.Add(formDatePicker.IsRequired ? "formNotEntered" : "formOptional"); } } htmlFieldset.Hidden.Value = formDatePicker.IsHidden; htmlContainer.Add(htmlFieldset); HtmlDatePicker htmlDatePicker = new HtmlDatePicker(formDatePicker.Path); htmlDatePicker.Class.Add("form-control"); htmlDatePicker.Disabled.Value = formDatePicker.IsDisabled; htmlDatePicker.ReadOnly.Value = formDatePicker.IsReadOnly; htmlDatePicker.DataDateFormat.Value = formDatePicker.DateFormat; htmlDatePicker.Value.Value = formDatePicker.HasValue ? formDatePicker.Value.ToString(formDatePicker.DateFormat.Replace('m', 'M'), CultureInfo.InvariantCulture) : ""; htmlDatePicker.Placeholder.Value = !string.IsNullOrEmpty(formDatePicker.Placeholder) ? formDatePicker.Placeholder : null; htmlDatePicker.AutoComplete.Value = "off"; if (formDatePicker.IsReadOnly) { htmlDatePicker.DataProvide.Value = null; } if (!initialize && firstInvalidId == null) { if (formDatePicker.IsRequired && !formDatePicker.HasValue || !formDatePicker.IsValid) { firstInvalidId = htmlDatePicker.Id.Value; } } switch (formDatePicker.OrderElements) { case OrderElements.LabelMarkInput: AddLabelMark(formDatePicker, htmlDatePicker, htmlFieldset); htmlFieldset.Add(htmlDatePicker); break; case OrderElements.MarkLabelInput: AddMarkLabel(formDatePicker, htmlDatePicker, htmlFieldset); htmlFieldset.Add(htmlDatePicker); break; case OrderElements.InputLabelMark: htmlFieldset.Add(htmlDatePicker); AddLabelMark(formDatePicker, htmlDatePicker, htmlFieldset); break; case OrderElements.InputMarkLabel: htmlFieldset.Add(htmlDatePicker); AddMarkLabel(formDatePicker, htmlDatePicker, htmlFieldset); break; case OrderElements.LabelInputMark: AddLabel(formDatePicker, htmlDatePicker, htmlFieldset); htmlFieldset.Add(htmlDatePicker); AddMark(formDatePicker, htmlDatePicker, htmlFieldset); break; case OrderElements.MarkInputLabel: AddMark(formDatePicker, htmlDatePicker, htmlFieldset); htmlFieldset.Add(htmlDatePicker); AddLabel(formDatePicker, htmlDatePicker, htmlFieldset); break; default: case OrderElements.NotSet: break; } if (initialize) { return; } string message = null; if (formDatePicker.UseLastMessage) { if (!string.IsNullOrEmpty(formDatePicker.LastMessage)) { message = formDatePicker.LastMessage; } } else if (formDatePicker.IsRequired && !formDatePicker.HasValue) { message = formDatePicker.RequiredMessage; } else if (!formDatePicker.IsValid) { message = formDatePicker.ValidationMessage; } if (message == null) { return; } HtmlLabel htmlLabelMessage = new HtmlLabel(verbose ? string.Format("{0}{1}", formDatePicker.Path, "Message") : ""); htmlLabelMessage.Class.Add("formValidationMessage"); htmlLabelMessage.For.Value = htmlDatePicker.Id.Value; htmlLabelMessage.Add(new HtmlText(message)); htmlFieldset.Add(htmlLabelMessage); }
public virtual void Visit(FormNumberSpinner formNumberSpinner, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formNumberSpinner.Path) : new HtmlDiv(); htmlDiv.Class.Add("formNumberSpinner"); if (!string.IsNullOrWhiteSpace(formNumberSpinner.CssClass)) { htmlDiv.Class.AddRange(formNumberSpinner.CssClass.Split(' ').Where(s => s != string.Empty)); } if (!string.IsNullOrWhiteSpace(formNumberSpinner.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formNumberSpinner.Path)); } htmlDiv.Class.Add("formField"); if (initialize) { htmlDiv.Class.Add(formNumberSpinner.IsRequired ? "formRequired" : "formOptional"); } else { if (formNumberSpinner.HasValue) { htmlDiv.Class.Add(formNumberSpinner.IsValid ? "formValid" : "formInvalid"); } else { htmlDiv.Class.Add(formNumberSpinner.IsRequired ? "formNotEntered" : "formOptional"); } } htmlDiv.Hidden.Value = formNumberSpinner.IsHidden; htmlContainer.Add(htmlDiv); HtmlTextBox htmlTextBox = new HtmlTextBox(formNumberSpinner.Path); htmlTextBox.Disabled.Value = formNumberSpinner.IsDisabled; htmlTextBox.ReadOnly.Value = formNumberSpinner.IsReadOnly || !formNumberSpinner.IsDirectInput; htmlTextBox.Value.Value = formNumberSpinner.HasValue ? formNumberSpinner.Value.ToString(string.Format("F{0}", formNumberSpinner.Precision)) : ""; string placeholder = null; if (!string.IsNullOrWhiteSpace(formNumberSpinner.Placeholder)) { if (formNumberSpinner.IsRequired && formNumberSpinner.IsRequiredInPlaceholder && !string.IsNullOrWhiteSpace(formNumberSpinner.RequiredMark)) { placeholder = string.Format("{0} {1}", formNumberSpinner.Placeholder, formNumberSpinner.RequiredMark); } else if (!formNumberSpinner.IsRequired && formNumberSpinner.IsOptionalInPlaceholder && !string.IsNullOrWhiteSpace(formNumberSpinner.OptionalMark)) { placeholder = string.Format("{0} {1}", formNumberSpinner.Placeholder, formNumberSpinner.OptionalMark); } else { placeholder = formNumberSpinner.Placeholder; } } htmlTextBox.Placeholder.Value = placeholder; if (formNumberSpinner.Update) { htmlTextBox.Change.Value = string.Format("__doPostBack('{0}', '');", formNumberSpinner.Path); } else { if (formNumberSpinner.HasValue) { htmlTextBox.DataNumber.Value = formNumberSpinner.Value; } if (formNumberSpinner.Min.HasValue) { htmlTextBox.DataMin.Value = formNumberSpinner.Min.Value; } if (formNumberSpinner.Max.HasValue) { htmlTextBox.DataMax.Value = formNumberSpinner.Max.Value; } htmlTextBox.DataStep.Value = formNumberSpinner.Step; htmlTextBox.DataPrecision.Value = formNumberSpinner.Precision; htmlTextBox.Blur.Value = string.Format("NumberSpinnerBlur('{0}')", htmlTextBox.Id.Value); scriptRegistry.Include("NumberSpinnerBlur"); } HtmlDiv htmlDivNumberSpinner = BuildDivNumberSpinner(formNumberSpinner, htmlTextBox); switch (formNumberSpinner.OrderElements) { case OrderElements.LabelMarkInput: AddLabelMark(formNumberSpinner, htmlTextBox, htmlDiv); htmlDiv.Add(htmlDivNumberSpinner); break; case OrderElements.MarkLabelInput: AddMarkLabel(formNumberSpinner, htmlTextBox, htmlDiv); htmlDiv.Add(htmlDivNumberSpinner); break; case OrderElements.InputLabelMark: htmlDiv.Add(htmlTextBox); AddLabelMark(formNumberSpinner, htmlTextBox, htmlDiv); break; case OrderElements.InputMarkLabel: htmlDiv.Add(htmlDivNumberSpinner); AddMarkLabel(formNumberSpinner, htmlTextBox, htmlDiv); break; case OrderElements.LabelInputMark: AddLabel(formNumberSpinner, htmlTextBox, htmlDiv); htmlDiv.Add(htmlDivNumberSpinner); AddMark(formNumberSpinner, htmlTextBox, htmlDiv); break; case OrderElements.MarkInputLabel: AddMark(formNumberSpinner, htmlTextBox, htmlDiv); htmlDiv.Add(htmlDivNumberSpinner); AddLabel(formNumberSpinner, htmlTextBox, htmlDiv); break; default: case OrderElements.NotSet: break; } if (initialize) { return; } string message = null; if (formNumberSpinner.UseLastMessage) { if (!string.IsNullOrEmpty(formNumberSpinner.LastMessage)) { message = formNumberSpinner.LastMessage; } } else if (formNumberSpinner.IsRequired && !formNumberSpinner.HasValue) { message = formNumberSpinner.RequiredMessage; } else if (!formNumberSpinner.IsValid) { message = formNumberSpinner.ValidationMessage; } if (message == null) { return; } HtmlLabel htmlLabelMessage = new HtmlLabel(verbose ? string.Format("{0}{1}", formNumberSpinner.Path, "Message") : ""); htmlLabelMessage.Class.Add("formValidationMessage"); htmlLabelMessage.For.Value = htmlTextBox.Id.Value; htmlLabelMessage.Add(new HtmlText(message)); htmlDiv.Add(htmlLabelMessage); }
public virtual void Visit(FormCheckBox formCheckBox, HtmlContainer htmlContainer) { HtmlFieldset htmlFieldset = verbose ? new HtmlFieldset(formCheckBox.Path) : new HtmlFieldset(); htmlFieldset.Class.Add("formCheckBox"); if (!string.IsNullOrWhiteSpace(formCheckBox.CssClass)) { htmlFieldset.Class.AddRange(formCheckBox.CssClass.Split(' ').Where(s => s != string.Empty)); } htmlFieldset.Class.AddRange(new string[] { "form-group", "switchBlock", "d-flex", "justify-content-between" }); if (!string.IsNullOrWhiteSpace(formCheckBox.Path)) { htmlFieldset.Class.Add(string.Format("{0}{1}", "formId", formCheckBox.Path)); } htmlFieldset.Class.Add("formField"); if (initialize) { htmlFieldset.Class.Add(formCheckBox.IsRequired ? "formRequired" : "formOptional"); } else { if (!formCheckBox.IsRequired || formCheckBox.Value) { htmlFieldset.Class.Add("formValid"); } else { htmlFieldset.Class.Add(formCheckBox.IsRequired ? "formNotEntered" : "formOptional"); } } htmlFieldset.Hidden.Value = formCheckBox.IsHidden; htmlContainer.Add(htmlFieldset); HtmlLabel htmlLabel = CreateCheckBox(formCheckBox); HtmlCheckBox htmlCheckBox = htmlLabel.Contents.Single(c => c is HtmlCheckBox) as HtmlCheckBox; if (!initialize && firstInvalidId == null) { if (formCheckBox.IsRequired && !formCheckBox.HasValue || !formCheckBox.IsValid) { firstInvalidId = htmlCheckBox.Id.Value; } } switch (formCheckBox.OrderElements) { case OrderElements.LabelMarkInput: AddLabelMark(formCheckBox, htmlCheckBox, htmlFieldset); htmlFieldset.Add(htmlLabel); break; case OrderElements.MarkLabelInput: AddMarkLabel(formCheckBox, htmlCheckBox, htmlFieldset); htmlFieldset.Add(htmlLabel); break; case OrderElements.InputLabelMark: htmlFieldset.Add(htmlLabel); AddLabelMark(formCheckBox, htmlCheckBox, htmlFieldset); break; case OrderElements.InputMarkLabel: htmlFieldset.Add(htmlLabel); AddMarkLabel(formCheckBox, htmlCheckBox, htmlFieldset); break; case OrderElements.LabelInputMark: AddLabel(formCheckBox, htmlCheckBox, htmlFieldset); htmlFieldset.Add(htmlLabel); AddMark(formCheckBox, htmlCheckBox, htmlFieldset); break; case OrderElements.MarkInputLabel: AddMark(formCheckBox, htmlCheckBox, htmlFieldset); htmlFieldset.Add(htmlLabel); AddLabel(formCheckBox, htmlCheckBox, htmlFieldset); break; default: case OrderElements.NotSet: break; } if (initialize) { return; } string message = null; if (formCheckBox.UseLastMessage) { if (!string.IsNullOrEmpty(formCheckBox.LastMessage)) { message = formCheckBox.LastMessage; } } else if (formCheckBox.IsRequired && !formCheckBox.Value) { message = formCheckBox.RequiredMessage; } else if (!formCheckBox.IsValid) { message = formCheckBox.ValidationMessage; } if (message == null) { return; } HtmlLabel htmlLabelMessage = new HtmlLabel(verbose ? string.Format("{0}{1}", formCheckBox.Path, "Message") : ""); htmlLabelMessage.Class.Add("formValidationMessage"); htmlLabelMessage.For.Value = htmlCheckBox.Id.Value; htmlLabelMessage.Add(new HtmlText(formCheckBox.RequiredMessage)); htmlFieldset.Add(htmlLabelMessage); }