Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir i need the asp .net coding in vb that if i select the one or more drop down list box the text also should display the values from the database as related to that drop down list box could u help me
Posted

1 solution

try like this
create a drop down in aspx page and create a SelectedIndexChanged
event for that dropdownlist then assign dropdownlist value to textbox
like

VB
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
       TextBox1.Text = DropDownList1.SelectedItem.Text
   End Sub

and set autopostback= true for dropdownlist
like
XML
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
            <asp:ListItem>12</asp:ListItem>
            <asp:ListItem>3</asp:ListItem>
            <asp:ListItem>5</asp:ListItem>
        </asp:DropDownList>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900