Below link will give you detail process with explainations to achieve what you want:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=77[
^]
Basically it is just a javascript:
<script language="javascript" type="text/javascript">
function CheckBoxListSelect(cbControl, state)
{
var chkBoxList = document.getElementById(cbControl);
var chkBoxCount= chkBoxList.getElementsByTagName("input");
for(var i=0;i<chkBoxCount.length;i++)
{
chkBoxCount[i].checked = state;
}
return false;
}
</script>