WebForm component CheckBoxList programming in ASP. NET (2)

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.