I have a CheckBoxList like following
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CheckBoxList1.Items.Add(new ListItem("Check/Uncheck All","0"));
CheckBoxList1.Items.Add(new ListItem("A","1"));
CheckBoxList1.Items.Add(new ListItem("B","2"));
CheckBoxList1.Items.Add(new ListItem("C", "3"));
CheckBoxList1.Items.Add(new ListItem("D", "4"));
}
}
I want whenever the first item is checked to check the rest of the items and whenever unchecked to uncheck the rest. Also the user can select every item separately.
I want do this with code behind without JavaScript or JQuery.