protected void btnSaveAndNext_Click(object sender, EventArgs e) { string strId = Request.QueryString.Get("id"); if (Grid1.Items.Count == 0) { SessionSet.PageMessage = "请先选择试卷!"; return; } if (!string.IsNullOrEmpty(hfPaperId.Value)) { //先删除后新增 ExamBLL examBLL = new ExamBLL(); examBLL.UpdateExamPaper(int.Parse(strId), int.Parse(hfPaperId.Value)); } Response.Redirect("SelectEmployeeDetail.aspx?mode=" + ViewState["mode"].ToString() + "&id=" + strId); }