function selectAll(checkbox) {
$(‘input[type=checkbox]‘).attr(‘checked‘, $(checkbox).attr(‘checked‘));
}
<th ><input type="checkbox" onclick="selectAll(this);" />全选</th>
gridview 或 Repeater 中
<asp:CheckBox ID="cbx" runat="server" />
C# javascript 全选按钮
原文:http://www.cnblogs.com/D-sD/p/4930158.html