JS脚本: <script language="javascript"> function SelectAll(tempControl) { //将除头模板中的其它所有的CheckBox取反 var theBox=tempControl; xState=theBox.checked; elem=theBox.form.elements; for(i=0;i
aspx.cs: //批量删除 private void LinkButton5_Click(object sender, System.EventArgs e) { try { foreach(DataGridItem item in this.DataGrid1.Items) { CheckBox cbx = (CheckBox)item.FindControl("chkItem"); if(cbx!=null && cbx.Checked) { int DelID = Convert.ToInt32(this.DataGrid1.DataKeys[item.ItemIndex].ToString()); opt.myDel("T_Message",DelID); } } } catch(Exception ex) { throw new Exception(ex.Message); } finally { FistBind(); } }
批量删除
最新推荐文章于 2024-08-05 22:35:13 发布