DropDownListSelectedByValue();替代SelectedValue=string
Posted on 2006-03-13 16:01 King0502 阅读(116) 评论(0) 编辑 收藏 举报
public static void DropDownListSelectedByValue(DropDownList ddl,string selectedValue){
ListItem item = ddl.Items.FindByValue(selectedValue);
if(item != null)
ddl.SelectedValue = selectedValue;
}
ListItem item = ddl.Items.FindByValue(selectedValue);
if(item != null)
ddl.SelectedValue = selectedValue;
}