DropDownList比较好的设置值的方式

DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(xxx));
通过FindByValue没有找到指定项返回值为null,而Items.IndexOf(null)会返回-1

原文地址:https://www.cnblogs.com/guanglin/p/2030434.html