function CheckAll()
{
   var AllCKBox = document.getElementsByTagName("input");
   var CKBox1 = document.getElementById("CheckBox1");
   if(CKBox1.checked==true){
   for (var i=0; i<AllCKBox.length; i++)
      if (AllCKBox[i].type == "checkbox") AllCKBox[i].checked = true;
   }
   else
   {
   for (var i=0; i<allcheckbox.length; i++)
      if (AllCKBox[i].type == "checkbox") AllCKBox[i].checked = false;
   }

<asp:CheckBox ></asp:CheckBox>

相关文章: