count dynamic checkboxes

  • Thread starter Mr. SweatyFinger
  • Start date
M

Mr. SweatyFinger

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

how can I do that??
thanks
 
M

Masudur

Mr. SweatyFinger said:
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
 
M

Mr. SweatyFinger

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
 
M

Masudur

Mr. SweatyFinger said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top