这是我刚做的关于复选框选择次数显示在LABLE里,可是再选别的选项,前个选项就被覆盖了、求解答
if (CheckBoxList1.SelectedIndex == 0){
L1 .Text = "1";
}
else
{
L1.Text = "0";
}
if (CheckBoxList1.SelectedIndex == 1)
{
L2.Text = "1";
}
else
{
L2.Text = "0";
}
if (CheckBoxList1.SelectedIndex == 2)
{
L3.Text = "1";
}
else
{
L3.Text = "0";
}
if (CheckBoxList1.SelectedIndex == 3)
{
L5.Text = "1";
}
else
{
L5.Text = "0";
}