예제 #1
0
        public void LoadMenuDB()
        {
            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = bll.Show(txt_number.Text);
            pds.AllowPaging      = true;
            pds.PageSize         = 12;
            pds.CurrentPageIndex = PageMenu;

            if (pds.IsFirstPage && pds.IsLastPage)
            {
                link_down.Enabled = false;
                link_up.Enabled   = false;
            }
            else if (pds.IsFirstPage)
            {
                link_up.Enabled   = false;
                link_down.Enabled = true;
            }
            else if (pds.IsLastPage)
            {
                link_up.Enabled   = true;
                link_down.Enabled = false;
            }
            else
            {
                link_up.Enabled   = true;
                link_down.Enabled = true;
            }
            DataList3.DataSource = pds;
            DataList3.DataBind();
        }
예제 #2
0
        public void LoadDB()
        {
            pds.DataSource       = bll.Show(txt_number.Text);
            pds.AllowPaging      = true;
            pds.PageSize         = 9;
            pds.CurrentPageIndex = Pages;

            if (pds.IsFirstPage && pds.IsLastPage)
            {
                link_previous.Enabled = false;
                link_next.Enabled     = false;
            }
            else if (pds.IsFirstPage)
            {
                link_previous.Enabled = false;
                link_next.Enabled     = true;
            }
            else if (pds.IsLastPage)
            {
                link_previous.Enabled = true;
                link_next.Enabled     = false;
            }
            else
            {
                link_previous.Enabled = true;
                link_next.Enabled     = true;
            }

            pagecount            = pds.DataSourceCount;
            lbl_page.Text        = "当前是" + (pds.CurrentPageIndex + 1).ToString() + "页  共有" + pds.PageCount.ToString() + "页  ";
            DataList3.DataSource = pds;
            DataList3.DataBind();
        }