Get selected Value from dropdownlist after submit?
- by sam
Hi guys,
I populate dropdownlist in ASP.NET webforms:
<asp:DropDownList runat="server" ID="salesman"></asp:DropDownList>
users= Buslayer.GetSalesRep();
foreach (userentity user in users)
{
salesman.Items.Add(new ListItem(user.FirstName + " " + user.LastName, user.UserID.ToString()));
}
after submission, I am still getting selected index = 0,
I tried all of this:
Response.Write("" + salesman.SelectedValue);
Response.Write("" + salesman.SelectedItem.Value);
Response.Write("" + salesman.SelectedIndex);
none works,
?????????????????????????????
thanks