asp.net 中如何获取CheckBoxList的值
2个回答
展开全部
string Quanxian = string.Empty;
if (CheckBoxList1.SelectedIndex == -1)
{
Func.Alert("请分配地区权限", this);
return;
}
else
{
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
Quanxian += li.Value.ToString() + ",";
}
}
Quanxian = Quanxian.Substring(0, Quanxian.Length - 1);
}
if (CheckBoxList1.SelectedIndex == -1)
{
Func.Alert("请分配地区权限", this);
return;
}
else
{
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
Quanxian += li.Value.ToString() + ",";
}
}
Quanxian = Quanxian.Substring(0, Quanxian.Length - 1);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询