Question : How to enable/disable a succeeding dropdown list if a value is selected on the first drop down list

Hello experts,
I'm interested in dynamic Drop down list. Let's say i've got three drop down list...
DDL1 - Yes/No
DDL2 - SQLDatasource
DDL3 - SQLDatasource
The condition/s are ...
IF DDL1 selected value is 'Yes' (Postback) DDL2 will be active and DDL3 is disabled.
IF DDL1 value is 'No' (Postback) DDL2 will be disabled and DDL3 is enabled.
Is this possible? Any code suggestion/s or links is much appreciated.

Answer : How to enable/disable a succeeding dropdown list if a value is selected on the first drop down list

       
 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (String.Compare(DropDownList1.SelectedValue, "Yes", true) == 0)
            {
                DropDownList2.Enabled = true;
                DropDownList3.Enabled = false;
            }
            else
            {
                DropDownList2.Enabled = false;
                DropDownList3.Enabled = true;
            }
        }
Random Solutions  
 
programming4us programming4us