how to change the value of dropdown list when user selects a value

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi
i am trying to use dropdown list but problem is that its value donot changes when user selects any different value .. value only changes when user clicks on button..
i want to change the value according to the selection which user made
a piece of code that i have written is following:
in .aspx
<asp:DropDownList ID="vendor" runat="server <br/>
<asp:ListItem Value="-1" Text="Search By Vendor </asp:ListItem><br/>
</asp:DropDownList>
its and texts are binded with the list which comes from database
in .aspx.cs
LoginBO loginbo = new LoginBO();
loginbo.vendor = vendor.SelectedValue; // here loginbo.vendor is data object
<span style="white-space:pre // and vendor.selectedvalue donot changes when different entry is selected but
<span style="white-space:pre // it changes on button click event

View the full article
 
Back
Top