protected void Page_Load(object sender, EventArgs e) { BindData(); //保存修改 if (Request.Form["SortId"] != null) { Array ids = Request.Form["SortId"].ToString().Split(','); Array numbers = Request.Form["TopicSortNumber"].ToString().Split(','); Array scores = Request.Form["TopicSortScore"].ToString().Split(','); for (int i = 0; i < ids.Length; i++) { Sort sort = new Sort() { SortId = int.Parse(ids.GetValue(i).ToString()), TopicSortNumber = int.Parse(numbers.GetValue(i).ToString()), TopicSortScore = int.Parse(scores.GetValue(i).ToString()) }; ExamBLL examBll = new ExamBLL(); if (examBll.UpdateExamSort(sort) < 0) { alert("修改失败"); return; } } BindData(); alert("修改成功", "ExamSort.aspx"); } BindData(); }