count dynamic checkboxes

Discussion in 'ASP .Net' started by Mr. SweatyFinger, Dec 1, 2006.

  1. I have a group of dynamically loaded check boxes.
    I need these clowns to check at least one.

    how can I do that??
    thanks
    Mr. SweatyFinger, Dec 1, 2006
    #1
    1. Advertising

  2. Mr. SweatyFinger

    Masudur Guest

    Mr. SweatyFinger wrote:
    > I have a group of dynamically loaded check boxes.
    > I need these clowns to check at least one.
    >
    > how can I do that??
    > thanks



    Hi,

    I presume you are using CheckBoxList of asp.net 2.0 if this is true.
    Then

    for (int i = 0; i < 10; i++)
    {
    ListItem item = new ListItem(i.ToString());
    CheckBoxList1.Items.Add(item);
    }

    CheckBoxList1.Items[3].Selected = true;

    setting the selected property of items setting to true will make the
    check box checked.

    But if you are using other than CheckBoxList then

    please provide a sample code

    Thanks

    Masudur
    Kaz Software Ltd.
    www.kaz.com.bd
    Masudur, Dec 1, 2006
    #2
    1. Advertising

  3. thank you , but that is not quite right
    yes i am using asp 2.0

    i want to validate the user that he checks one with his mouse
    thanks
    Mr. SweatyFinger, Dec 1, 2006
    #3
  4. Mr. SweatyFinger

    Masudur Guest

    Mr. SweatyFinger wrote:
    > thank you , but that is not quite right
    > yes i am using asp 2.0
    >
    > i want to validate the user that he checks one with his mouse
    > thanks


    Then try

    CheckBoxList1.SelectedItem

    in your code.....

    Thanks
    Masudur, Dec 1, 2006
    #4
    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. trint
    Replies:
    2
    Views:
    1,117
    trint
    Sep 5, 2007
  2. gangur
    Replies:
    1
    Views:
    1,561
    ProgTalk
    Feb 22, 2008
  3. Dan
    Replies:
    5
    Views:
    3,225
    shawpnendu
    May 26, 2009
  4. pizzy
    Replies:
    7
    Views:
    156
    pizzy
    Mar 23, 2005
  5. Replies:
    1
    Views:
    302
    David Dorward
    Dec 17, 2007
Loading...

Share This Page