CheckBoxList -- Iterating Through Items

Discussion in 'ASP .Net' started by Ron, Jul 15, 2003.

  1. Ron

    Ron Guest

    Can someone tell me how I can iterate through all of the Checkboxes included
    within a checkbox list?


    The code I currently have is as follows (it doesnt work for some reason, it
    returns that no items are selected):

    foreach(ListItem objItem in chkCategory.Items)
    {
    if(objItem.Selected == true)
    {
    category += objItem.Text;
    }
    }


    Thanks,

    Ron
    Ron, Jul 15, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Fox

    Iterating through Repeater.Items

    Mark Fox, Nov 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    8,160
    Mark Fox
    Nov 14, 2003
  2. Bryan
    Replies:
    1
    Views:
    763
    Steven Cheng[MSFT]
    Mar 1, 2006
  3. Bart Van Hemelen
    Replies:
    2
    Views:
    4,651
    Bart Van Hemelen
    Sep 4, 2006
  4. Anjan Bhowmik
    Replies:
    1
    Views:
    457
    Misbah Arefin
    Feb 14, 2008
  5. carl
    Replies:
    5
    Views:
    2,329
    James Kanze
    Nov 25, 2009
Loading...

Share This Page