All JS checkbox Select/Reverse and bulk Delete

Source: Internet
Author: User


Delete Menu Information
protected void Lbdelete_click (object sender, EventArgs e)
{
Zztj. Bll. Sysmenuinfo list = new ZZTJ. Bll. Sysmenuinfo ();
List. Delete (request.form["MenuID"). ToString ());
Bindmenus ();
}


<script type= "Text/javascript Tutorial" >
var A;
function Checkall () {
if (a==1)
{
for (Var i=0;i<window.document.form1.elements.length;i++)
{
var e = form1.elements[i];
E.checked =false;
}
a=0;
}
Else
{
for (Var i=0;i<window.document.form1.elements.length;i++)
{
var e = form1.elements[i];
E.checked =true;
}
A=1;
}
}
function Checkdel () {
var number=0;
for (Var i=0;i<window.document.form1.elements.length;i++)
{
var e = form1.elements[i];
if (e.name!= "Checkboxall")
{
if (e.checked==true)
{
number=number+1;
}
}
}
if (number==0)
{
Alert ("Please select the item you want to delete!") ");
return false;
}
if (window.confirm) ("Do you confirm deletion?") "))
{
return true;
}
Else
{
return false;
}
}
<asp Tutorial: LinkButton id= "Lbdelete" runat= "Server" onclientclick= "Javascript:return Checkdel ();" Onclick= "Lbdelete_ Click ">
Delete </asp:LinkButton>
<input id= "Checkboxall" type= "checkbox" onclick= "Checkall ()"/>
<input id= "checkbox" Name= "MenuID" type= "checkbox" Value= "<% #Eval (" menu_id ")%>"/> "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.