checkboxlist control example

checkboxlist control example

Previous Home Next

 

The CheckBoxList control is used to create a multi-selection check box group.

Each selectable item in a CheckBoxList control is defined by a ListItem element!

  
   

   

 ..............designcode for checkboxlist control...................
....................................................................

        a
        aa
        bb
        bbb
        cc
        gg
    
....................................................................
..................cs code for button clic...........................
....................................................................
  protected void Button1_Click(object sender, EventArgs e)
    {
        string s = "";
        for (int i = 0; i < 6; i++)
        {
            if (CheckBoxList1.Items[i].Selected)
            {
                s = s + CheckBoxList1.Items[i].Text.ToString()+"\n";
            
            }
           
        }
        TextBox1.Text = s;
    }
.......................................................................
Previous Home Next