Custom Validator and CheckBoxList
Recently, I was working on WebForms, with a CustomValidator associated to a CheckBoxList. The validator is working correctly, but is shown on a new line. For the rest of the controls, like textbox or dropdownlist, it works perfectly.
This is caused because the Checkboxlist, generates a HTML table element, wich by default is a block level element.
To fix this, we must add a CSS class to the checkboxlist, with the style property:
{
float: left;
}
With this style, the CustomValidator will be shown next to the CheckBoxList.
Deja un comentario