Populate 2nd dropdown by first dropdown value in asp.net vb

后端 未结 3 1468
温柔的废话
温柔的废话 2021-01-25 13:22

I\'m having a bit of trouble using asp.net vb What I want to do is have 2 dropdown boxes

The first dropdown would have 1 2 3 for example.

the second dropdown wo

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-25 14:09

    You can do it server side or in Java Script. The general concept is the same though. You have to target the second dropdown in the "change" event of the first dropdown. Meaning whenever the change event fires for the first one, you update the second one

    Sudo code:

    Dropdown1_Changed()
    {
      //if "1" is selected in Dropdown1, update Dropdown2 to select "c"
    }
    

提交回复
热议问题