Asp. NET page CheckBoxList components detailed

Source: Internet
Author: User
Tags net

The checkbox selection component is a common component in a program. This component is used in programming, and is usually not used in any way, often in the form of multiple such components. If you are using multiple checkbox components in a asp.net page, there is a convenient way to use the CheckBoxList component in addition to adding multiple checkbox components to the page. The CheckBoxList component consists of a set of checkbox components in which the checkbox appears as an entry and has an index number for each checkbox in the CheckBoxList assembly, which is easier to process in the program.

You may ask, this is not superfluous, since there is a CheckBox component, but also CheckBoxList components to do? This is because in the process of programming, it is often much easier and more obvious to process CheckBoxList components than to process the checkbox components. Examples are as follows:

Suppose you have a CheckBoxList component and 10 checkbox components, and this CheckBoxList component is made up of these 10 checkbox components.

A. How to create a CheckBoxList component:

 
  
  
  1. asp:checkboxlist runat = "server" id = C1 >
  2. Asp:listitem Value = 1 > first check box (/asp:listitem >)
  3. Asp:listitem Value = 2 > second check box-/asp:listitem >
  4. Asp:listitem Value = 3 > Third check box-/asp:listitem >


.....
Note: You can add a few check boxes here
/asp:checkboxlist >

By adding the above statement to the ASP.net page, you can produce a CheckBoxList component called "C1".

Two. Properties that are frequently used in CheckBoxList components:

1.TextAlign attribute: Value: Left, right. If the value of the textalign is left, the text of the check box in the CheckBoxList component is on the left-hand side of the marquee, and similarly, if the TextAlign value is right the text of the check box is on the right-hand side of the marquee.

2.Selected property: Is a Boolean that determines whether the check box in the component is selected.

3.RepeatColumns property: There are several check boxes in the CheckBoxList component, which basically sets how many rows the check boxes will display.

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.