protected void Button4_Click(object sender, EventArgs e) { int id; for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1"); if (cb.Checked) { id = Convert.ToInt32(GridView1.DataKeys[i].Value); Help help = new Help(); help.ID = id; BLLhelp bllhelp = new BLLhelp(); int result = bllhelp.delete(help); if (result > 0) { Common.MessageAlert.AlertLocation(Page, "alert('批量删除成功');location.href='helplist.aspx'"); //Response.Write("<script>alert('批量删除成功');</script>"); } else { Common.MessageAlert.Alert(Page, "批量删除失败"); } } } }
protected void Button4_Click(object sender, EventArgs e) { int id; for (int i = 0; i < GridView1.Rows.Count; i++) { id = Convert.ToInt32(GridView1.DataKeys[i].Value); Help help = new Help(); help.ID = id; BLLhelp bllhelp = new BLLhelp(); int result=bllhelp.delete(help); if (result>0) { Common.MessageAlert.AlertLocation(Page, "alert('批量删除成功');location.href='helplist.aspx'"); } else { Common.MessageAlert.Alert(Page,"批量删除失败"); } } }