Link to home
Start Free TrialLog in
Avatar of nahguam
nahguam

asked on

DropDownList1_SelectedIndexChanged

I have a basic drop-down list on my page, auto postback set to true... with the below simple code on the selected index changed event i put the selected index into an int variable....

selected always returns as 0 (zero) regardless of the item selected. Or if I change to use a string with SelectedValue it always returns the first item in the list... Do I have to do something special to get it working???

private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
     int selected = DropDownList1.SelectedIndex;
}
ASKER CERTIFIED SOLUTION
Avatar of Abirami Rajendran
Abirami Rajendran
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial