469,609 Members | 1,178 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Checkboxlist problem?

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
Nov 19 '05 #1
1 1109
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


"Lynn" <yeltnab1@_NOSPAM_hotmail.com> wrote in message
news:mO********************@comcast.com...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dm_dal | last post: by
3 posts views Thread by Dune | last post: by
4 posts views Thread by Patrick.O.Ige | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.