You can check this jquery implementation
<script type="text/javascript">
$(document).ready(function () {
$("input[id*='CheckBoxList1']").click(function (e) {
var currentId = $(this);
if (currentId.val() == "select all") {
$("input[id*='CheckBoxList1']").each(function () {
if ($(this).val() != "select all")
$(this).attr("checked", true);
});
}
else {
$("input[id*='CheckBoxList1'][value*='select all']").attr("checked", false);
}
});
});
</script>
<div>
<asp:checkboxlist id="CheckBoxList1" runat="server" xmlns:asp="#unknown">
<asp:listitem>select all</asp:listitem>
<asp:listitem>a</asp:listitem>
<asp:listitem>b</asp:listitem>
<asp:listitem>c</asp:listitem>
<asp:listitem>d</asp:listitem>
</asp:checkboxlist>
</div>