protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e) { if (check()) { CourseBLL courBLL = new CourseBLL(); string courName = TextBox_courName.Text.Trim(); string credit = TextBox_credit.Text.Trim(); string schoolHour = TextBox_schoolHour.Text.Trim(); Course course = new Course(); course.Name = courName; course.Credit = credit; course.SchoolHour = schoolHour; courBLL.save(course); Response.Write("<script>alert('添加成功!');location.href='addCourse.aspx';</script>"); } }