Hi everyone,
I am stumpped...
I have a long list of checkboxes that I have saved their states to a database. If a record for our particular date is in the database, I want to load up all the states to each checkbox.
Instead of manually doing
for each item I was kind of hoping to do the following:
Each column in the DB has the same name as the control name. Can I "find" the control by name and then change it's value.
eg.
Any direction/help is appreciated. I know this would help if the list of checkboxes grew.
Thanks.
Xcalibre
I am stumpped...
I have a long list of checkboxes that I have saved their states to a database. If a record for our particular date is in the database, I want to load up all the states to each checkbox.
Instead of manually doing
Code:
cbItem1.value = CSTR(rdr("Item1))
Each column in the DB has the same name as the control name. Can I "find" the control by name and then change it's value.
eg.
Code:
For x = 0 to rdr.FieldCount -1
ctrol = Page.FindControl(rdr.GetName(x))
ctrol.selected = rdr(x)
Next x
Any direction/help is appreciated. I know this would help if the list of checkboxes grew.
Thanks.
Xcalibre