前台代码 复制代码 代码如下: <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" width="16" height="16" border="0" /> 删 除 </asp:LinkButton> <br><input id="CheckBoxAll" type="checkbox" onclick="CheckAll()" /> <br><input id="CheckBox" name="MenuID" type="checkbox" value="<%#Eval("Menu_ID") %>" /> <br> </div> <br>后台代码 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="22055" class="copybut" id="copybut22055" onclick="doCopy('code22055')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code22055"> <br>// 删除菜单信息 <br>protected void lbDelete_Click(object sender, EventArgs e) <br>{ <br>ZZTJ.BLL.SysMenuInfo list = new ZZTJ.BLL.SysMenuInfo(); <br>list.Delete(Request.Form["MenuID"].ToString()); <br>BindMenus(); <br>} <br> </div>