Get Selected Values From a CheckBoxList in C#





-6
Date Submitted Mon. Oct. 24th, 2005 5:22 PM
Revision 1 of 1
Helper ses5909
Tags CheckBoxList | Selected | Values | VB.NET
Comments 4 comments
Get Selected Values From a CheckBoxList in C#
// Get Values from CheckBoxList
String values = "";
for (int i=0; i< cbl.Items.Count; i++)
{
        if(cbl.Items[i].Selected)
        {
                values += cbl.Items[i].Value + ",";
        }
}
                       
values = values.TrimEnd(',');

Sara Smith

www.ilovecode.com
Sara

ilovecode

Comments

Comments Not sure but...
Thu. Sep. 21st, 2006 8:04 AM    Scripter Pio
Comments Thanks.. works great
Mon. Dec. 18th, 2006 11:45 PM    Newbie mixilplix
Comments Another way
Thu. Nov. 15th, 2007 4:54 AM    Newbie cykophysh
Comments good one
Tue. Oct. 14th, 2008 3:31 AM    Newbie khaled88

Voting