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. Advertisements

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,490
    Mark Fox
    Nov 14, 2003
  2. JD
    Replies:
    5
    Views:
    12,579
    NetArchitect
    Aug 8, 2007
  3. Brian Henry
    Replies:
    5
    Views:
    10,255
    Steven Cheng[MSFT]
    Aug 3, 2004
  4. Patrick.O.Ige
    Replies:
    5
    Views:
    19,836
    Patrick.O.Ige
    Jun 19, 2005
  5. Bryan
    Replies:
    1
    Views:
    969
    Steven Cheng[MSFT]
    Mar 1, 2006
  6. Bart Van Hemelen
    Replies:
    2
    Views:
    4,904
    Bart Van Hemelen
    Sep 4, 2006
  7. Anjan Bhowmik
    Replies:
    1
    Views:
    672
    Misbah Arefin
    Feb 14, 2008
  8. carl
    Replies:
    5
    Views:
    3,183
    James Kanze
    Nov 25, 2009
Loading...