hsingh1981
Programmer
Hi all,
I'm fairly new to asp.net. Am using vb.net in my asp pages. I have combo box named location, if a user selects London or edinburgh. I would like it to populate the other combo box called destination.
How do i do this? I can fill the combo box using this code
But don't know how to trigger the action when the location combo box is picked by the user, so to populate the destination combo box?
many thanks
I'm fairly new to asp.net. Am using vb.net in my asp pages. I have combo box named location, if a user selects London or edinburgh. I would like it to populate the other combo box called destination.
How do i do this? I can fill the combo box using this code
Code:
sub Fill_Location()
' to populate combo box
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Try
conn.Open(application("dblocation"))
Catch ex As Exception
'MsgBox("ERROR: Database cannot be opened. See system administrator. MESSAGE: " + ex.Message.ToString, MsgBoxStyle.Critical, "APPLICATION ERROR")
Exit Sub
End Try
rs.Open("Ref_Location", conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockPessimistic)
rs.MoveFirst()
Do While Not rs.EOF
Location.Items.Add(rs.Fields("Location").Value)
rs.MoveNext()
Loop
rs.Close()
conn.Close()
end sub
But don't know how to trigger the action when the location combo box is picked by the user, so to populate the destination combo box?
many thanks