DropDownList has a SelectedValue which is invalid because it does not exist in the list of items
问题 Here's the scenario: The selections in DropDownList are bound from a DB Table listing the acceptable values. At one point in time the values were: One Two Three Four At some point later, the list of acceptable values change to: One Two Four Five However, the field in the DB that stores the dropdown's value still contains a value of "Three" on some rows. When loading one of those row and setting SelectedValue as such: dd.SelectedValue = data.Field; // where data.Field == "Three" ...an error is