李晓亮的博客

导航

AspNet基础-常间问题及处理

[一]DropDownList的常见问题
1.常见的错误提示
1.1错误提示:
     解决办法:
2.选中指定项的方法:
2.1DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue("CodeVal"));
或 ListItem selItem=DropDownList1.Items.FindByValue("CodeVal"); if(selItem!=null){DropDownList1.ClearSelection();selItem.Selected = true;}

posted on 2012-05-04 00:29  LeeXiaoLiang  阅读(68)  评论(0)    收藏  举报