<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
//--------------- Division CheckBox Start ----------------
$("#TrDivision [id*=chkAllDivision]").click(function () {
if ($(this).is(":checked")) {
$("#TrDivision [id*=cblDivision]").attr("checked", "checked");
} else {
$("#TrDivision [id*=cblDivision]").removeAttr("checked");
}
});
$("#TrDivision [id*=cblDivision]").click(function () {
if ($("#TrDivision [id*=cblDivision]").length == $("#TrDivision [id*=cblDivision]:checked").length) {
$("#TrDivision [id*=chkAllDivision]").attr("checked", "checked");
} else {
$("#TrDivision [id*=chkAllDivision]").removeAttr("checked");
}
});
//--------------- Division CheckBox End ------------------
//--------------- Status CheckBox Start ----------------
$("#TrStatus [id*=chkAllStatus]").click(function () {
if ($(this).is(":checked")) {
$("#TrStatus [id*=cblStatus]").attr("checked", "checked");
} else {
$("#TrStatus [id*=cblStatus]").removeAttr("checked");
}
});
$("#TrStatus [id*=cblStatus]").click(function () {
if ($("#TrStatus [id*=cblStatus]").length == $("#TrStatus [id*=cblStatus]:checked").length) {
$("#TrStatus [id*=chkAllStatus]").attr("checked", "checked");
} else {
$("#TrStatus [id*=chkAllStatus]").removeAttr("checked");
}
});
//--------------- Status CheckBox End ----------------
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table >
<tr id="TrDivision">
<td>Division : <%--<input id="chkAllDivision" runat="server" type="checkbox" />--%>
<asp:CheckBox ID="chkAllDivision" runat="server" />
</td>
<td><asp:CheckBoxList ID="cblDivision" runat="server" RepeatDirection="Horizontal">
<asp:ListItem >A</asp:ListItem>
<asp:ListItem >B</asp:ListItem>
<asp:ListItem >C</asp:ListItem>
<asp:ListItem >D</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr id="TrStatus">
<td>Status :<input id="chkAllStatus" runat="server" type="checkbox" /></td>
<td><asp:CheckBoxList ID="cblStatus" runat="server" RepeatDirection="Horizontal">
<asp:ListItem >ALL</asp:ListItem>
<asp:ListItem >NO</asp:ListItem>
<asp:ListItem >YES</asp:ListItem>
<asp:ListItem >PENDING</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
</form>
</body>
</html>This code snippet for check all and UnCheck all CheckboxList in One Table using JQuery in ASP.NET.