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

后端 未结 3 1436
温柔的废话
温柔的废话 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 13:58

    I would proboby use the SelectedIndexChanged event on the first dropdownlist. Like this:

    ASPX

    
        
        
        
    
    
        
        
        
    
    

    VB

    Private Sub ddl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl1.SelectedIndexChanged
        If ddl1.SelectedValue = "1" Then
            ddl2.SelectedValue = "C"
        End If
    End Sub
    

提交回复
热议问题