private void LoadData()
        {
            //  Repeater1.DataSource = TinTuc_Info.getall();
            //Repeater1.DataBind();
            List <TinTuc_Info> list;;
            PagedDataSource    objPds = new PagedDataSource();

            list = TinTuc_Info.getall();

            objPds.DataSource  = list;
            objPds.AllowPaging = true;
            objPds.PageSize    = 5;//số bài lặp trong 1 trang

            objPds.CurrentPageIndex = CurrentPage;
            Label2.Text             = (CurrentPage + 1).ToString() + "\\" + objPds.PageCount.ToString();

            //Disable tien va lui buttons
            bntTroLai.Enabled = !objPds.IsFirstPage;
            bntNext.Enabled   = !objPds.IsLastPage;
            if (objPds.DataSourceCount == 0)
            {
                Label2.Text       = "0";
                bntNext.Visible   = false;
                bntTroLai.Visible = false;
            }
            Repeater1.DataSource = objPds;
            Repeater1.DataBind();
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridView1.DataSource = TinTuc_Info.getall();
     GridView1.DataBind();
     MultiView1.ActiveViewIndex = 0;
 }