DropDownList 默认展示从数据库查询的值

1、 DropDownList 默认展示从数据库查询的值

 DropDownList1.Items.FindByValue(model.ClassConfig.ToString()---要展示的值).Selected = true;

2、RadioButtonList1 对查询出来的数据默认展示

foreach (ListItem item in this.RadioButtonList1.Items)
           {
            
if (item.Value == model.IsChildorg.ToString())//modeluser.userpower.tostring()为你要赋值的值
               {
                   item.Selected 
= true;
                   
break;
               }
           }

posted @ 2011-07-13 18:04  Snow*Cao  阅读(277)  评论(0编辑  收藏  举报