..


Sponsored Links

CheckBoxList

The object of the family of CheckBoxList Web Server Control ASP.NET creates a list of radio buttons multiple managed by the server side. NET Framework, formatted into a HTML table.

Let's see the list of properties of the CheckBoxList:

  • CellPadding - sets the padding inside the cell that contains the checkboxes.
  • CellSpacing - sets the padding outside the cell that contains the checkboxes.
  • RepeatColumns - contains the number of checkboxes to display in the control.
  • RepeatDirection - specifies whether the checkbox should be set horizontally or vertically, depending on this information, will be assigned a value of Vertical or Horizontal.
  • RepeatLayout - specifies whether or not the checkboxes should be contained in a table, then using values ​​respectively Table or Flow.
  • TextAlign - sets the alignment of the checkbox values ​​through the Left, Center or Right.
Runat attribute is always applied (set to "server") to allow. NET Framework to recognize it as a server-side object.

Let's see a simple example:





 <script runat="server">







 Sub Select (sender As Object, e As EventArgs)



    



 Dim i



    



 RISULTATO.Text = "Color / selected the / i:"



    



 For i = 0 To COLORI.Items.Count - 1



        



 If COLORI.Items (s). Selected Then



            



 RISULTATO.Text COLORI.Items + = (i). Text + ""



        



 End If



    



 Next







 End Sub







 </ Script>









 <form runat="server">







 <asp:CheckBoxList id="COLORI" AutoPostBack="True" OnSelectedIndexChanged="Seleziona" runat="server">







 <asp:ListItem> Red </ asp: ListItem>







 <asp:ListItem> Yellow </ asp: ListItem>







 <asp:ListItem> Green </ asp: ListItem>







 <asp:ListItem> Blue </ asp: ListItem>







 </ Asp: CheckBoxList>







 <br>







 <asp:label id="RISULTATO" runat="server"/>







 </ Form>



In the same category ...
E-Learning
ASP (Advanced) ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €.
ASP.NET (Course) ASP.NET (Course)
Full course for building Web applications from 49 €.
SQL and Database (Course) SQL and Database (Course)
Create and manage relational databases. From 39 €.
Sponsored Links