Hi Team,
I have two dropdown List and second dropdown value will bind based on selecting first one . I am using vb net as language. So What approch I can follow as OnSelectedIndexChanged event we cannot use in vb. Please help if any.
Hi Team,
I have two dropdown List and second dropdown value will bind based on selecting first one . I am using vb net as language. So What approch I can follow as OnSelectedIndexChanged event we cannot use in vb. Please help if any.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit MohantyPosted Apr 7, 2023, 3:55 AM
In VB.NET, you can use the
SelectedIndexChangedevent of the first dropdown list to dynamically populate the second dropdown list.First, create the two dropdown lists and the first dropdown list has the
AutoPostBackproperty set toTrueand theOnSelectedIndexChangedevent set toddlDropDownList_SelectedIndexChanged.Then, in your code-behind file, add the following code:
Rajkiran SwainPosted Apr 6, 2023, 6:44 PM
Rajeesh MenothPosted Apr 6, 2023, 4:16 PM
Hi,
Go through the following article for VB - https://www.aspsnippets.com/Articles/Populate-Cascading-DropDownList-from-Database-in-ASPNet-Example.aspx