I'm getting an error when SelctedIndexChanged
, When the value change he gives me the previous selected value and not the new selected value.
What's the problem here.
And what's the difference between
DropDownList.SelectedItem.Value
DropDownList.SelectedValue
SelectedValues returns the Value of the selecteditem or "" if there is none.
SelectedItem returns the selected item. SelectedItem.Value return the .Value of the SelectedItem. SelectedItem.Value will throw an error if there is no selected item, because SelectedItem will return null, and .Value of null will throw the error.