Checkboxlist problem?

L

Lynn

Hello,

I have a page that allows the person to select multiple items from a
checkboxlist. The checkboxlist is being populated from a table in the
database. The user's selections are sent to the database as a comma
separated list (ex. 17, 22, 35).

I also have a page that allows the user to edit existing records. I am
unsure of how to build the checkboxlist on the edit page and have the
various checkboxes checked based on what is in the particular record.

Can somebody guide me here? Would I be better of using a multi select
listbox, or would I run into the same problem in trying to display the
selections based on what is in the database?

Thank you for the help,

Lynn
 
P

Pat

Lynn
In your Edit page u can make the checkboxes checked depending on the value
by using
FindByValue method of the CheckBoxList's Items collection.
Try looking through the article below and sure it should help
http://aspnet.4guysfromrolla.com/articles/050703-1.aspx
You can also use for example a Repeater or Datalist Control and the write a
function that would return a Boolean
and later append that to your checkBoxes.
If you need more info let me know
Patrick
 

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,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top