I have a dropdownlist control with a selectedindexchanged event that fires correctly. However, when you select an item from the list the index value that is returned to the selectedindexchanged event does not change; the list box pops back tot the first item in the list.
ASP DROP DOWN LIST CONTROL:
<asp:DropDownList ID="CuisineList" runat="server" Width="100"
AutoPostBack = "true" onselectedindexchanged="CuisineList_SelectedIndexChanged" >
</asp:DropDownList>
DATA BOUND TO CONTROL IN PAGELOAD EVENT:
protected void Page_Load(object sender, EventArgs e)
{
//Load drop down lists for restaurant selection
BLgetMasterData obj = new BLgetMasterData();
var cusineList = obj.getCuisines();
CuisineList.DataSource = cusineList;
CuisineList.DataBind();
CuisineList.Items.Insert(0, "Any");
SELECTEDINDEXCHANGEDEVENT:
protected void CuisineList_SelectedIndexChanged(object sender, EventArgs e)
{
if (IsPostBack)
{
string def = this.CuisineList.SelectedItem.Value;
//ALWAYS returns index '0'
}
}