选择checkBoxList|radiobuttonlist|dropdownlist 的的值

选择checkBoxList|radiobuttonlist|dropdownlist 的的值
public void  SelectListIndex(ListControl lc,string values)
        {
            string[] tempValues = values.Split(',');
            if (tempValues.Length > 0)
            {
                foreach (string tempvalue in tempValues)
                   foreach (ListItem li in lc.Items)
                    {
                        if (li.Value == tempvalue)                      
                            li.Selected = true;
                    }
            }
          
        }

你可能感兴趣的:(选择checkBoxList|radiobuttonlist|dropdownlist 的的值)