DdlVIFLID为DropDownList控件,objVehicle.VI_FL_ID为实体属性的值(string类型) //方法1:把DdlVIFLID中Value为objVehicle.VI_FL_ID的项置为选中, //如果objVehicle.VI_FL_ID为空或者DdlVIFLID中无Value为 //objVehicle.VI_FL_ID的项会引发System.NullReferenceException。 DdlVIFLID.Items.FindByValue(objVehicle.VI_FL_ID).Selected = true; //方法2:把DdlVIFLID选中项的Value置为objVehicle.VI_FL_ID后DdlVIFLID中Value为 //objVehicle.VI_FL_ID的项被选中,此objVehicle.VI_FL_ID为空不会引发异常(此时默认第一项为选中项), //但DdlVIFLID中无Value为objVehicle.VI_FL_ID的项会引发System.ArgumentOutOfRangeException。 DdlVIFLID.SelectedValue = objVehicle.VI_FL_ID;