how to get selected value of Disabled dropdown in c#

后端 未结 3 2030
南方客
南方客 2021-01-18 13:26

In my form there are two DropDownList controls.

1st is enabled and 2nd is disabled.

After selecting 1st dropdown I am changing selected value of 2nd dropdown

3条回答
  •  逝去的感伤
    2021-01-18 14:22

    If you are trying to read the value of 2nd dropdown (disabled one) at server, you will never be able to read the updated value, becuase data in disabled controls will not be posted back to server from client.

    You should either enable the dropdown before posting your data to server or use hidden controls to hold data of your disabled dropdown.

提交回复
热议问题