Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > count dynamic checkboxes

Reply
Thread Tools

count dynamic checkboxes

 
 
Mr. SweatyFinger
Guest
Posts: n/a
 
      12-01-2006
I have a group of dynamically loaded check boxes.
I need these clowns to check at least one.

how can I do that??
thanks


 
Reply With Quote
 
 
 
 
Masudur
Guest
Posts: n/a
 
      12-01-2006

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

 
Reply With Quote
 
 
 
 
Mr. SweatyFinger
Guest
Posts: n/a
 
      12-01-2006
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


 
Reply With Quote
 
Masudur
Guest
Posts: n/a
 
      12-01-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
count the number of checkboxes subashini General Computer Support 0 03-06-2012 09:07 AM
how to count number of unchecked checkboxes in a gridview? Dan ASP .Net 5 05-26-2009 09:07 AM
Count of Checkboxes checked in datalist gangur ASP .Net 1 02-22-2008 05:24 AM
gridview with checkboxes problem (loosing rows count)... trint ASP .Net 2 09-05-2007 02:36 AM
Revised: A form -to- dynamic form -to- dynamic checkboxes pizzy Javascript 7 03-23-2005 10:53 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57