K
kevin.j.hutchison
I want to conditionally enable a textbox based on the selection of a
dropdown.
I have 2 entries in the dropdown: Nothing (value 99), Enabled (value
1), Disabled (value 0). Autopostback on the dropdown and textbox are
set to true.
The code in Page_Load is ...
private void Page_Load(object sender, System.EventArgs e){
this.TextBox1.Enabled = this.DropDownList1.SelectedValue == "1";
}
This works fine, for one change in the dropdown selection. After I
change the value a second time it stops working.
My background is windows programming, so I am not entirely comfortable
with this. I searched the group and the help pages to see what the
problem could be, but didn't see anything. Any help is appreciated.
- K.
dropdown.
I have 2 entries in the dropdown: Nothing (value 99), Enabled (value
1), Disabled (value 0). Autopostback on the dropdown and textbox are
set to true.
The code in Page_Load is ...
private void Page_Load(object sender, System.EventArgs e){
this.TextBox1.Enabled = this.DropDownList1.SelectedValue == "1";
}
This works fine, for one change in the dropdown selection. After I
change the value a second time it stops working.
My background is windows programming, so I am not entirely comfortable
with this. I searched the group and the help pages to see what the
problem could be, but didn't see anything. Any help is appreciated.
- K.