I have some checkBox in my page,
I want that the user checked maximum data but no more,
how can I cancel the select option.
here is my code:
thanks!PHP Code:protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
int select = 0;
int max =3;
if (max > 0)
{
for (int i = 0; i < checkBoxGrid.Items.Count; i++)
{
CheckBox cb = (CheckBox)checkBoxGrid.Items[i].FindControl("CheckBox1");
if (cb.Checked)
{
select++;
if (max == select)
{
//HERE I WANT TO CANCEL
}
}
}
}
}




Reply With Quote