.net 获取checkBoxList 选中的值|radiobuttonlist|dropdownlist

.net 获取checkBoxList 选中的值

public string GetCheckBoxListValues(ListControl lc)
        {
            string tempValues = "";
            foreach (ListItem li in lc.Items)
            {
                if (li.Selected)
                    tempValues += li.Value+",";
            }
           tempValues = tempValues.Trim(',');
           return tempValues;
        }

你可能感兴趣的:(.net)