前台代码 复制代码 代码如下: <BR>var a; <BR>function CheckAll(){ <BR>if(a==1) <BR>{ <BR>for(var i=0;i<window.document.form1.elements.length;i++) <BR>{ <BR>var e = form1.elements[i]; <BR>e.checked =false; <BR>} <BR>a=0; <BR>} <BR>else <BR>{ <BR>for(var i=0;i<window.document.form1.elements.length;i++) <BR>{ <BR>var e = form1.elements[i]; <BR>e.checked =true; <BR>} <BR>a=1; <BR>} <BR>} <BR>function CheckDel(){ <BR>var number=0; <BR>for(var i=0;i<window.document.form1.elements.length;i++) <BR>{ <BR>var e = form1.elements[i]; <BR>if (e.Name != "CheckBoxAll") <BR>{ <BR>if(e.checked==true) <BR>{ <BR>number=number+1; <BR>} <BR>} <BR>} <BR>if(number==0) <BR>{ <BR>alert("请选择需要删除的项!"); <BR>return false; <BR>} <BR>if (window.confirm("你确认删除吗?")) <BR>{ <BR>return true; <BR>} <BR>else <BR>{ <BR>return false; <BR>} <BR>} <BR><asp:LinkButton ID="lbDelete" runat="server" OnClientClick="javascript:return CheckDel();" onclick="lbDelete_Click"> <BR><img alt="" src="../images/del.gif" style="max-width:90%" style="max-width:90%" border="0" /> 删 除 <BR><input id="CheckBoxAll" type="checkbox" onclick="CheckAll()" /> <BR><input id="CheckBox" name="MenuID" type="checkbox" value="<%#Eval("Menu_ID") %>" /> <BR> 后台代码 复制代码 代码如下: // 删除菜单信息 protected void lbDelete_Click(object sender, EventArgs e) { ZZTJ.BLL.SysMenuInfo list = new ZZTJ.BLL.SysMenuInfo(); list.Delete(Request.Form["MenuID"].ToString()); BindMenus(); }