$(function(){
$("#parent").click(function(){
$("[name=child]:checkbox").attr("checked",$(this).attr("checked"));
})
//删除提示
$("#btnDelete").click(function(){ if($("[name=child]:checkbox:checked").length==0){alert("请您选择要删除的数据!"); return false; } else{return confirm("您确定要删除所选数据吗?");} })
//html
<input id="Checkbox1" type="checkbox" name ="child" value="<%#Eval("Id") %>"/>
<input id="parent" type="checkbox" />全选
<asp:CheckBox ID="chkAll" runat="server" onclick="CheckAll(this);"/>
function CheckAll(sender)
{
$(":input[type='checkbox']").attr("checked", true);
}