Home » ASP.Net

ASP.Net How to loop through a ChecklBoxList control in C#

4. August 2010 by jdelpay 0 Comments
string msg = "";
        string selectionResult = "";
        foreach (ListItem li in CheckBoxList1.Items)
        {
            if (li.Selected == true)
            {
                msg += "<br>" + li.Text;
            }
            selectionResult = msg;
        }