cant get values from items on dropdownlist

tecaul

New Member
i have this in my page:\[code\]<asp:DropDownList ID="membros" runat="server"></asp:DropDownList>\[/code\]and in the code behind i have this:\[code\] protected void Page_Load(object sender, EventArgs e) { members.Items.Clear(); members.Items.Add(new ListItem("Choose...", "")); foreach (DataRow item in com.Execute("select * from tableMembers").Rows) { members.Items.Add(new ListItem(item["name"].ToString(), item["id_user"].ToString())); contForeach++; } }\[/code\]and when i try to get the value from SelectedIndex i cant because he always get me 0 independently of what index i choose.
 
Back
Top