<html>
<head>
<title>三层遍历删除_www.jb200.com</title>
<script src="/js/
jquery1.7.js" type="text/
javascript"></script>
<script type="text/javascript">
$(function () {
$('#
checkbox1').click(function () {
if ($('#Checkbox1').is(':
checked')) {
$('td input').attr('checked', true);
}
else { $('td input').attr('checked', false); }
})
$('#Checkbox2').click(function () {
$('td input').each(function () {
$(this).attr('checked', !$(this).attr('checked'))
})
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Checkbox1" type="checkbox" />全选<input id="Checkbox2" type="checkbox" />反选<asp:Button
ID="Button1" runat="server" Text="删除" onclick="Button1_Click" />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="选择">
<ItemTemplate>
<asp:CheckBox ID="CheckBox3" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Id" HeaderText="编号" />
<asp:BoundField DataField="NewsTitle" HeaderText="标题" />
<asp:BoundField DataField="NewsContent" HeaderText="新闻内容">
<ItemStyle Width="200px" />
</asp:BoundField>
<asp:BoundField DataField="NewsCreator" HeaderText="创建者" />
<asp:BoundField DataField="CreateTime" HeaderText="创建时间" />
</Columns>
</asp:GridView>
</div>
</form>