示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserInfo"] != null)
            {
                user = Session["UserInfo"] as UserInfo;
            }

            courseid = Request.QueryString["CourseID"];
            System.Text.RegularExpressions.Regex rex = new System.Text.RegularExpressions.Regex(@"^\d+$");
            if (courseid == null || !rex.IsMatch(courseid))
            {
                Response.Redirect("/aspx/CourseList.aspx");
            }

            course.CourseID = int.Parse(courseid);
            course.UserID   = user.UserID;
            course.GetCourseInfo();
            Teacher_TA = course.GetCourseTeacher();
            mycomment  = course.GetMyCourseComment();

            if (!Page.IsPostBack)
            {
                AllDataBind();
            }
        }