Adding all selected Items from CheckBox List to SortedList in ASP.net 2.0
chkSubCategories --> A CheckBoxList Control which is already populated with some values.
using System.Collections;
SortedList objL = new SortedList();
for (int i = 0; i < chkSubCategories.Items.Count; i++)
{
if (chkSubCategories.Items[i].Selected == true)
{
objL.Add(chkSubCategories.Items[i].Value, chkSubCategories.Items[i].Text);
}
}
Subscribe to:
Post Comments (Atom)
Labels
- Adobe (12)
- Alternative (64)
- Amazing English (52)
- ASP.net (56)
- C# QA (40)
- Coding (56)
- DotNet (38)
- DownLoad (329)
- EBooks (22)
- Freeware (335)
- Google (41)
- Health Care (27)
- Intro (161)
- Jokes (86)
- Mail (249)
- News (76)
- Question Answer (292)
- QuickStarts (88)
- Quotes (53)
- SharePoint (115)
- Sharepoint Interview Questions (12)
- SQL (97)
- SQL Question Answers (104)
- TechVideos (200)
- Tweak (68)

0 comments:
Post a Comment