protected void DeleteTA_Button_Click(object sender, CommandEventArgs e) { if (Session["UserInfo"] != null) { CourseInfo c = new CourseInfo(); c.CourseID = course.CourseID; c.UserID = int.Parse(e.CommandArgument.ToString()); c.DropCourseAssistant(); AllDataBind(); //Response.Redirect(Request.Url.AbsoluteUri); } }
protected void DeleteTA_Button_Click(object sender, CommandEventArgs e) { if (Session["UserInfo"] != null) { CourseInfo c = new CourseInfo(); c.CourseID = course.CourseID; c.UserID = int.Parse(e.CommandArgument.ToString()); if (1 == c.DropCourseAssistant()) { AllDataBind(); } else { ScriptManager.RegisterStartupScript(Page, GetType(), "deletefailed", "alert('删除失败');", true); } } else { HttpContext.Current.Response.Write("<script type='text/javascript'>alert('闲置时间过长,请重新登录');location.href='" + Request.Url.AbsoluteUri + "'</script>"); } }