469,572 Members | 1,306 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Populating Drop down box value

Hello,

i want to populate the drop down box values based on the first drop down box
value, actually i have form in which user will select a car maker and based
on that value below 2 drop down box values will be populated
For example user select Suzuki and based on that value in one drop down car
models will be shown and in secound one car type will be shown, how can i do
it in ASP.NET, please tell me, i'm using MS-Access DB.
Thanks.
Nov 19 '05 #1
1 1095
in the onselectedindexchanged event of the first control you need to
bind the second dropdown to a datasource passing the selected item
value from the first dropdown (control.selecteditem.value)

for instance:

if model id is an integer:

string selectCommand = "select model_id, model from table where
model_id =" + ddlMake.selecteditem.value;

if model id is an string:

string selectCommand = "select model_id, model from table where
model_id ='" + ddlMake.selecteditem.value + "'";

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mike Wilcox | last post: by
1 post views Thread by msnews.microsoft.com | last post: by
4 posts views Thread by Pete Lux | last post: by
2 posts views Thread by Jim in Arizona | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.