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