Exemplo n.º 1
0
        protected void AspNetPager_PageChanged(object src, EventArgs e)
        {
            int index;// = AspNetPager.CurrentPageIndex;

            if (Request.QueryString["Page"] == null)
            {
                index = 1;
            }
            else
            {
                index = Convert.ToInt32(Request.QueryString["Page"]);
                AspNetPager.CurrentPageIndex = index;//一直都是1,所以用这种法子给它改
            }
            AllAdvice_DataList.DataSource = FilterTable(alladvice.Tables["CourseAdvice"], AspNetPager.StartRecordIndex - 1, AspNetPager.EndRecordIndex - 1);
            AllAdvice_DataList.DataBind();
        }
Exemplo n.º 2
0
        private void AllDataBind()
        {
            course.CourseID = int.Parse(courseid);
            course.UserID   = user.UserID;
            course.GetCourseInfo();
            Teacher_TA = course.GetCourseTeacher();

            Modify_Intro.Text     = course.Introduction;
            T_DataList.DataSource = course.GetCourseTeacher().Tables["TeacherName"];
            T_DataList.DataBind();
            A_DataList.DataSource = course.GetCourseTeacher().Tables["AssistantName"];
            A_DataList.DataBind();
            alladvice = course.GetCourseAdvice();
            AspNetPager.RecordCount       = alladvice.Tables["CourseAdvice"].Rows.Count;
            AllAdvice_DataList.DataSource = FilterTable(alladvice.Tables["CourseAdvice"], AspNetPager.StartRecordIndex - 1, AspNetPager.EndRecordIndex - 1);
            AllAdvice_DataList.DataBind();
        }