前台:
后台:
protected void Page_Load(object sender, EventArgs e)
{
CheckBoxList1.SelectedIndexChanged += new EventHandler(CheckBoxList1_SelectedIndexChanged);
}
void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (CheckBoxList1.Items[0].Selected)
{
for (int i = 1; i < CheckBoxList1.Items.Count; i++)
{
CheckBoxList1.Items[i].Enabled = false;
}
}
else
{
for (int i = 1; i < CheckBoxList1.Items.Count; i++)
{
CheckBoxList1.Items[i].Enabled = true;
}
}
}