troubleshooting Question

How to pre populate CheckBoxList control from values in a database table

Avatar of amagondes
amagondesFlag for United States of America asked on
.NET ProgrammingASP.NET
13 Comments1 Solution1083 ViewsLast Modified:
I'm very new to but so far I love it! I have a few tables as follows:

InventoryItemID | Name | Description

CarFeatureID | Name

InventoryItemID | CarFeatureID

What I'm trying to do is create a web form called UpdateInventoryItem.aspx, and on that page have a CheckBoxList control that populates from CarFeature (no problems here). The problem I'm having is getting to check selected items based on InventoryItem_CarFeature.

So, if you were to access UpdateInventoryItem.aspx?InventoryItemID=1
It should render the full checkboxlist based on CarFeature but set the appropriate items as selected based on the values in InventoryItem_CarFeature where InventoryItemID = Request.QueryString["InventoryItemID"]

I hope that makes sense!
Thanks for the help!

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros