Hi
I am using C# and Access databse for a web site.
I have a drop down list which I need to populate dynamically according to results in a database.
Example
There will be 1 drop down list on the page which offers 3 makes of cars:
Mazda, Honda, Ford
The user selects this, the page performs the postback and a new box appears beside it offering 5 colours:
Red, Blue, Green White, Orange
Now let's pretend Mazda only comes in Red and blue and green.
Honda only comes Red, Green and White
For comes in Blue, White and Orange
This means if the user selects Mazda, after the page does the postback and displays drop down list 2 the only options are Red Blue and Green (etc for the other makes)
How do I populate the correct options in the drop down list depending on the choice of car. In the past, I have done this manually with if else statements, but is there any easier way?
Thanks
Dave
I am using C# and Access databse for a web site.
I have a drop down list which I need to populate dynamically according to results in a database.
Example
There will be 1 drop down list on the page which offers 3 makes of cars:
Mazda, Honda, Ford
The user selects this, the page performs the postback and a new box appears beside it offering 5 colours:
Red, Blue, Green White, Orange
Now let's pretend Mazda only comes in Red and blue and green.
Honda only comes Red, Green and White
For comes in Blue, White and Orange
This means if the user selects Mazda, after the page does the postback and displays drop down list 2 the only options are Red Blue and Green (etc for the other makes)
How do I populate the correct options in the drop down list depending on the choice of car. In the past, I have done this manually with if else statements, but is there any easier way?
Thanks
Dave
Comment