ASP.Net之Datalist详解【删除(源码)】
aspx界面
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>DataList控件删除操作(支持批量删除)</title>
<script type="text/javascript">
function CheckAll(Obj) {
var AllObj = document.all;
if (Obj.checked)//全选
{
for (var i = 0; i < AllObj.length; i++) {
if (AllObj[i].type == "checkbox") {
AllObj[i].checked = true;
}
}
}
else//反选
{
for (var i = 0; i < AllObj.length; i++) {
if (AllObj[i].type == "checkbox") {
AllObj[i].checked = false;
}
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<fieldset style="text-align: center; width: 540px;">
<legend style=" text-align:center; ">使用Datalist删除数据(支持批量删除)</legend>
<asp:DataList ID="DataList1" runat="server"
onitemcommand="DataList1_ItemCommand" DataKeyField="id">
<HeaderTemplate>
<div style="text-align:center">
<table border = "1" cellpadding="0" cellspacing="0" style=" font-size:12; width:500px" >
<tr>
<td style="width:100px">全选/反选<input id="Checkbox1" type="checkbox" name="全选" value="全选" onclick="return CheckAll(this)" title="全选" /></td>
<td style="width:100px">用户编号</td>
<td style="width:100p
相关新闻>>
- 发表评论
-
- 最新评论 更多>>