Posted on: 9/21/2012 11:52:27 PM | Views : 214

Hi all..
i am having a problem.! i have a method where i get a list of a type, the i want to add some properites to a dropdownlist, if i use
ddlItemNames .Items.Add("some"); it works fine, but when i use ddlItemNames .Items.Add(new Listitem("text","value" ));
when i on the ddlItemNames_SelectedIndexChanged method want to get the text and value of the selected item it is always the first item that works..!
here is the code that i use..
<asp:DropDownList ID="ddlItemNames" runat="server" Width="155" onselectedindexchanged="ddlItemNames_SelectedIndexChanged" AutoPostBack="true"> </asp:DropDownList>
 
 
 
private void loadItemnames() { ddlItemNames.Items.Clear(); List<ItemName> list = getItemnameList(); // this code do return a list. if ...

Go to the complete details ...