1. How to Create a CheckBoxList component:
<Asp: CheckBoxList runat = "server" id = C1>
<Asp: ListItem Value = 1> first check box </asp: ListItem>
<Asp: ListItem Value = 2> second check box </asp: ListItem>
<Asp: ListItem Value = 3> third check box </asp: ListItem>
.....
Note: You can add several check boxes here.
</Asp: CheckBoxList>
Add the preceding statement to the ASP. NET page to generate a CheckBoxList component named "C1.
2. Attributes frequently used in the CheckBoxList component:
I>. TextAlign property: the value is Left or Right. If the value of TextAlign is Left, the text of the check box in the CheckBoxList component is on the Left of the check box. Similarly, if the value of TextAlign is Right, the text of the check box is on the Right of the check box.
II>. Selected attribute: boolean type, used to determine whether the check box in the component is Selected.
III>. RepeatColumns attributes: There are several check boxes in the CheckBoxList component. This attribute mainly sets the number of rows used to display these check boxes.
IV>. RepeatDirection attribute: the value of this attribute can be Vertical or Horizontal. After the RepeatColumns attribute is set, it is set to arrange the check boxes in the component. The details are as follows:
Assume that the CheckBoxList component has four check boxes and the RepeatColumns attribute value is 2.