How to update control state in asp.net/ajax?
- by darth_alexious
I'm trying to update certain controls according to a selection in a dropdown list.
For example, in the "selectedIndexChanged" event of a dropDownList, if a user selects the value "sport-car" the text box "payload" is disabled and the textbox "max speed" is enabled.
private sub dropDownList1_SelectedIndexChanged(byval sender as object, byval e as eventargs) handles dropDownList1.SelectedIndexChanged
If dropDownList1.selectedValue = "sport-car" then
textBox_payLoad.enabled = false
textBox_maxSpeed.enabled = true
end if
end sub
When I'm doing something like this, the controls aren't enabled/disabled, even the event (wich I've added a breakpoint) seems not to be raised (sometimes several time after it is raised). Also, when the instructions in the condition is executed, nothing changes.
What am I doing wrong? Maybe this is a very easy issue, but I'm a begginer in MS Visual Web Developer.