不能在DropDownList中选择多个项

描述:在OnPreRender方法 ,为DropDownList绑定数据并将选中的值设为true,页面显示正常

   当页面跳转时,又进行一次绑定,页面报错“不能在DropDownList中选择多个项”

解决:   DetailType.DataSource = dt_DetailType;
             DetailType.DataValueField = "PFD_Type";
             DetailType.DataTextField = "PFD_Name";
             DetailType.DataBind();
             DetailType.ClearSelection();  // 添加这行代码

猜你喜欢

转载自www.cnblogs.com/jinbaolai/p/10006466.html