//删除多条记录
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     MultiProblem multi = new MultiProblem();//创建MultiProblem对象
     foreach (GridViewRow dr in GridView1.Rows)//对GridView中的每一行进行判断
     {
         if (((CheckBox)dr.FindControl("xuanze")).Checked)//如果选择了进行删除
         {
             int ID = int.Parse(((Label)dr.FindControl("Label1")).Text);
             multi.ID = ID;
             multi.DeleteByProc(ID);
         }
     }
 }
 //删除试题事件
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     MultiProblem multiproblem = new MultiProblem();  //创建单选题对象
     int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString()); //取出要删除记录的主键值
     if (multiproblem.DeleteByProc(ID))
     {
         Response.Write("<script language=javascript>alert('成功删除试题!')</script>");
     }
     else
     {
         Response.Write("<script language=javascript>alert('该题已被收录入试卷,请勿删除!')</script>");
     }
     GridViewBind();//重新绑定数据
     GridView1.EditIndex = -1;
 }