当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.PagedDataSource类代码示例

本文整理汇总了C#中System.Web.UI.WebControls.PagedDataSource的典型用法代码示例。如果您正苦于以下问题:C# PagedDataSource类的具体用法?C# PagedDataSource怎么用?C# PagedDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PagedDataSource类属于System.Web.UI.WebControls命名空间,在下文中一共展示了PagedDataSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindData

		private void BindData()
		{
			PagedDataSource pds = new PagedDataSource();
			pds.AllowPaging = true;
			pds.PageSize = PagerTop.PageSize;

			using ( DataTable dt =
						YAF.Classes.Data.DB.user_list( PageContext.PageBoardID, null, null,
						group.SelectedIndex <= 0 ? null : group.SelectedValue,
						rank.SelectedIndex <= 0 ? null : rank.SelectedValue
						) )
			{
				using ( DataView dv = dt.DefaultView )
				{
					if ( name.Text.Trim().Length > 0 || ( Email.Text.Trim().Length > 0 ) )
						dv.RowFilter = string.Format( "Name like '%{0}%' and Email like '%{1}%'", name.Text.Trim(), Email.Text.Trim() );

					PagerTop.Count = dv.Count;
					pds.DataSource = dv;

					pds.CurrentPageIndex = PagerTop.CurrentPageIndex;
					if ( pds.CurrentPageIndex >= pds.PageCount ) pds.CurrentPageIndex = pds.PageCount - 1;

					UserList.DataSource = pds;
					UserList.DataBind();
				}
			}
		}
开发者ID:coredweller,项目名称:PhishMarket,代码行数:28,代码来源:users.ascx.cs

示例2: DataListBindEnrollList

        //绑定信息
        public void DataListBindEnrollList()
        {
            //检查是否有活动届次和活动类型数据

            if (!(ddlGameCategory.Items.Count > 0 && ddlGameType.Items.Count > 0))
            {
                Javascript.GoHistory(-1, "当前暂无活动届次和活动类型信息:(", Page);
                return;
            }

            DalOperationAboutGameDrawList doan = new DalOperationAboutGameDrawList();
            DataTable dt = doan.GetList(int.Parse(ddlGameCategory.SelectedValue), int.Parse(ddlGameType.SelectedValue)).Tables[0];

            this.AspNetPager3.RecordCount = dt.Rows.Count;
            AspNetPager3.PageSize = CommonUtility.pageSize;

            PagedDataSource pds = new PagedDataSource();    //定义一个PagedDataSource类来执行分页功
            pds.DataSource = dt.DefaultView;
            pds.AllowPaging = true;

            pds.CurrentPageIndex = AspNetPager3.CurrentPageIndex - 1;
            pds.PageSize = AspNetPager3.PageSize;

            this.dlEnroll.DataSource = pds;
            this.dlEnroll.DataBind();

            if (pds.Count == 0)
            {
                this.dlEnroll.ShowFooter = true;
            }
            else
            {
                this.dlEnroll.ShowFooter = false;
            }
        }
开发者ID:skyaspnet,项目名称:usta,代码行数:36,代码来源:DrawManage.aspx.cs

示例3: LoadData

 protected void LoadData()
 {
     db dbc = new db();
     string query = "SELECT * FROM pages ORDER BY id DESC";
     dbc.cmd.CommandText = query;
     SqlDataAdapter da = new SqlDataAdapter(dbc.cmd);
     DataTable dt = new DataTable();
     da.Fill(dt);
     PagedDataSource pgitems = new PagedDataSource();
     DataView dv = new DataView(dt);
     pgitems.DataSource = dv;
     pgitems.AllowPaging = true;
     pgitems.PageSize = 9;
     pgitems.CurrentPageIndex = PageNumber;
     if (pgitems.PageCount > 1)
     {
         rptPages.Visible = true;
         ArrayList pages = new ArrayList();
         for (int i = 0; i < pgitems.PageCount; i++)
             pages.Add((i + 1).ToString());
         rptPages.DataSource = pages;
         rptPages.DataBind();
     }
     else
         rptPages.Visible = false;
     rptContent.DataSource = pgitems;
     rptContent.DataBind();
 }
开发者ID:nick2il,项目名称:GavanGallery,代码行数:28,代码来源:default.aspx.cs

示例4: DropDownList1_SelectedIndexChanged

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["TtNum"].ConnectionString;
            SqlConnection conn = new SqlConnection(connectionString);

            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("select * from GoodSort2 where GoodSort2.GS_ID='" + DropDownList1.SelectedValue + "'", conn);
            DataSet ds = new DataSet();
            try
            {
                conn.Open();
                da.Fill(ds, "GoodSort2");
                conn.Close();
            }
            catch (SqlException e2)
            {
                Response.Write(e2.ToString());
            }
            PagedDataSource obj = new PagedDataSource();
            obj.DataSource = ds.Tables["GoodSort2"].DefaultView;
            DropDownList2.DataSource = obj;
            this.DropDownList2.DataTextField = "Sort_name";
            this.DropDownList2.DataValueField = "Sort2_ID";
            DropDownList2.DataBind();
        }
开发者ID:JJDJJ,项目名称:TtNum,代码行数:25,代码来源:see.aspx.cs

示例5: Bind

 private void Bind()
 {
     PagedDataSource ps = new PagedDataSource();
     ps.DataSource = bll.ShowAllAd();
     ps.AllowPaging = true;
     ps.PageSize = 3;
     lbPage.Text = ps.PageCount.ToString();
     ps.CurrentPageIndex = currentPage;
     FirstPage.Enabled = true;
     PriorPage.Enabled = true;
     NextPage.Enabled = true;
     LastPage.Enabled = true;
     if (lbCurrentPage.Text == "1")
     {
         FirstPage.Enabled = false;
         PriorPage.Enabled = false;
     }
     if (lbCurrentPage.Text == ps.PageCount.ToString())
     {
         NextPage.Enabled = false;
         LastPage.Enabled = false;
     }
     AdsDataList.DataSource = ps;
     AdsDataList.DataKeyField = "ID";
     AdsDataList.DataBind();
 }
开发者ID:wakaoyun,项目名称:dengqibin,代码行数:26,代码来源:AdsInfo.aspx.cs

示例6: LoadData

 protected void LoadData()
 {
     QuiTrinhDAO qtdao = new QuiTrinhDAO();
     DataTable dt = new DataTable();
     dt = qtdao.DSQuiTrinh();
     PagedDataSource pgitems = new PagedDataSource();
     System.Data.DataView dv = new System.Data.DataView(dt);
     pgitems.DataSource = dv;
     pgitems.AllowPaging = true;
     pgitems.PageSize = 15;
     pgitems.CurrentPageIndex = PageNumber;
     if (pgitems.PageCount > 1)
     {
         rptPages.Visible = true;
         System.Collections.ArrayList pages = new System.Collections.ArrayList();
         for (int i = 0; i < pgitems.PageCount; i++)
             pages.Add((i + 1).ToString());
         rptPages.DataSource = pages;
         rptPages.DataBind();
     }
     else
         rptPages.Visible = false;
     rpTinTuc.DataSource = pgitems;
     rpTinTuc.DataBind();
 }
开发者ID:baotiit,项目名称:savvyplatform,代码行数:25,代码来源:QuanLyQuiTrinh.aspx.cs

示例7: show

        public void show()
        {
            SqlConnection conn = sqlHelper.Connection();
            string CommandText = @"select * from ShopThing";
            DataSet dataSet = sqlHelper.DataSetBySqlCommand(CommandText, conn);

            int curpage = Convert.ToInt32(this.Label2.Text);
            PagedDataSource ps = new PagedDataSource();
            DataSet ds = dataSet; //这里是数据源

            ps.DataSource = ds.Tables[0].DefaultView;
            ps.AllowPaging = true; //是否可以分页
            ps.PageSize = 10; //显示的数量,也就是每页要显示多少条记录
            ps.CurrentPageIndex = curpage - 1; //取得当前页的页码

            this.LinkButton1.Enabled = true;
            this.LinkButton2.Enabled = true;
            this.LinkButton3.Enabled = true;
            this.LinkButton4.Enabled = true;

            if (curpage == 1)
            {
                this.LinkButton1.Enabled = false;//不显示首页按钮
                this.LinkButton2.Enabled = false;//不显示上一页按钮
            }
            if (curpage == ps.PageCount)
            {
                this.LinkButton3.Enabled = false;//不显示下一页
                this.LinkButton4.Enabled = false;//不显示尾页
            }
            this.Label1.Text = Convert.ToString(ps.PageCount);

            DataList1.DataSource = ps;
            DataList1.DataBind();
        }
开发者ID:ningboliuwei,项目名称:Course_ASPNET,代码行数:35,代码来源:BookLogin.aspx.cs

示例8: grdbind

        public void grdbind()
        {
            using (Entities bll = new Entities())
                {

                    IEnumerable<L_RForm> lfeed;
                    if (!string.IsNullOrEmpty(Request.Params["ID"]))
                    {
                        _Id = int.Parse(HttpContext.Current.Request.QueryString["ID"]);
                        lfeed = bll.L_RForm.Where(p => p.FID == _Id).OrderByDescending(p => p.FID).Select(c => c);
                    }
                    else
                    {
                        lfeed = bll.L_RForm.OrderByDescending(p => p.FID).Select(c => c);

                    }

                    PagedDataSource pds = new PagedDataSource();
                    pds.DataSource = lfeed.ToList();  //这里好像一定要Tolist();不然会有点错误;
                    pds.AllowPaging = true;
                    AspNetPager1.RecordCount = lfeed.Count(); //记录总数;
                    pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
                    pds.PageSize = AspNetPager1.PageSize;
                    this.rptList.DataSource = pds;
                    this.rptList.DataBind();
                }
        }
开发者ID:priceLiu,项目名称:CMS,代码行数:27,代码来源:RList.aspx.cs

示例9: RptBind

        private void RptBind(string strWhere)
        {
            Cms.DAL.NewsInfo dal = new Cms.DAL.NewsInfo();
            if (String.IsNullOrEmpty(strWhere))
                strWhere = "IsLock = 0";
            else
                strWhere += " AND IsLock = 0";

            DataSet ds = dal.GetList(strWhere);
            DataView dv = ds.Tables[0].DefaultView;
            //利用PAGEDDAGASOURCE类来分页
            PagedDataSource pds = new PagedDataSource();
            AspNetPager1.RecordCount = dv.Count;
            pds.DataSource = dv;
            pds.AllowPaging = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize = AspNetPager1.PageSize;
            //获得总条数
            pcount = dv.Count;
            if (this.pcount == 0)
            {
                this.lbmsg.Visible = true;
                this.lbmsg.Text = "暂时没有新闻";
            }
            //绑定数据
            rptList.DataSource = pds;
            rptList.DataBind();
        }
开发者ID:BGCX261,项目名称:zhongzhiweb-svn-to-git,代码行数:28,代码来源:News.aspx.cs

示例10: LoadData

 void LoadData()
 {
     string query;
     db dbc = new db();
     query = "SELECT * FROM pictures ORDER BY date DESC";
     if (Request.QueryString["sort"] == "oldest")
         query = "SELECT * FROM pictures ORDER BY date ASC";
     else if (Request.QueryString["sort"] == "byalphaup")
         query = query = "SELECT * FROM pictures ORDER BY id DESC";
     else if (Request.QueryString["sort"] == "byalphadown")
         query = query = "SELECT * FROM pictures ORDER BY id ASC";
     dbc.cmd.CommandText = query;
     SqlDataAdapter da = new SqlDataAdapter(dbc.cmd);
     DataTable dt = new DataTable();
     da.Fill(dt);
     PagedDataSource pgitems = new PagedDataSource();
     System.Data.DataView dv = new System.Data.DataView(dt);
     pgitems.DataSource = dv;
     pgitems.AllowPaging = true;
     pgitems.PageSize = 9;
     pgitems.CurrentPageIndex = PageNumber;
     if (pgitems.PageCount > 1)
     {
         rptPages.Visible = true;
         System.Collections.ArrayList pages = new System.Collections.ArrayList();
         for (int i = 0; i < pgitems.PageCount; i++)
             pages.Add((i + 1).ToString());
         rptPages.DataSource = pages;
         rptPages.DataBind();
     }
     else
         rptPages.Visible = false;
     rptContent.DataSource = pgitems;
     rptContent.DataBind();
 }
开发者ID:nick2il,项目名称:GavanGallery,代码行数:35,代码来源:default.aspx.cs

示例11: FetchData

        // paging for repeater
        private void FetchData(int take, int pageSize)
        {
            using (NORTHWNDEntities dc = new NORTHWNDEntities())
            {
                var query = from p in dc.Employees
                            .OrderBy(o => o.FirstName)
                            .Take(take)
                            .Skip(pageSize)
                            select new
                            {
                                ID = p.EmployeeID,
                                Name = p.FirstName + "" + p.LastName,
                                Count = dc.Employees.Count()
                            };

                PagedDataSource page = new PagedDataSource();
                page.AllowCustomPaging = true;
                page.AllowPaging = true;
                page.DataSource = query;
                page.PageSize = 10;

                rEmployees.DataSource = page;
                rEmployees.DataBind();

                if (!IsPostBack)
                {
                    RowCount = query.First().Count;
                    CreatePagingControl();
                }
            }
        }
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:32,代码来源:Employees.aspx.cs

示例12: RptBind

        public int pcount = 0; //总条数

        #endregion Fields

        #region Methods

        public void RptBind(string strWhere)
        {
            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            DataSet ds = dal.GetList(strWhere);
            DataView dv = ds.Tables[0].DefaultView;
            //利用PAGEDDAGASOURCE类来分页
            PagedDataSource pds = new PagedDataSource();
            AspNetPager1.RecordCount = dv.Count;
            pds.DataSource = dv;
            pds.AllowPaging = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize = AspNetPager1.PageSize;
            //获得总条数
            pcount = dv.Count;
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
            //绑定数据
            rptList.DataSource = pds;
            rptList.DataBind();
        }
开发者ID:BGCX261,项目名称:zhongzhiweb-svn-to-git,代码行数:32,代码来源:List.aspx.cs

示例13: DataBindEnglishExamSignUpInfo

        //绑定搜索的四六级报名信息
        public void DataBindEnglishExamSignUpInfo()
        {
            DalOperationAboutEnglishExam doac = new DalOperationAboutEnglishExam();
            DataView dv = doac.GetEnglishExamSignUpInfoByTeacherNoAndLocale("admin", ddlSerachSchoolClass.SelectedValue == "all", ddlSerachSchoolClass.SelectedValue, txtKeyword.Text.Trim().Length > 0, txtKeyword.Text.Trim(), false, ddlSearchLocale.SelectedValue).Tables[0].DefaultView;

            this.AspNetPager2.RecordCount = dv.Count;

            PagedDataSource pds = new PagedDataSource();    //定义一个PagedDataSource类来执行分页功
            pds.DataSource = dv;
            pds.AllowPaging = true;

            pds.CurrentPageIndex = AspNetPager2.CurrentPageIndex - 1;
            pds.PageSize = CommonUtility.pageSize; ;

            this.dlstEnglishExamSignUpInfo.DataSource = pds;
            this.dlstEnglishExamSignUpInfo.DataBind();

            if (pds.Count == 0)
            {
                this.dlstEnglishExamSignUpInfo.ShowFooter = true;
            }
            else
            {
                this.dlstEnglishExamSignUpInfo.ShowFooter = false;
            }
        }
开发者ID:skyaspnet,项目名称:usta,代码行数:27,代码来源:EnglishExamManage.aspx.cs

示例14: Bind

 private void Bind()
 {
     PagedDataSource ps = new PagedDataSource();            
     ps.DataSource = bll.ShowAllAreafact();            
     ps.AllowPaging = true;
     ps.PageSize = 5;
     lbPage.Text = ps.PageCount.ToString();
     ps.CurrentPageIndex = currentPage;
     FirstPage.Enabled = true;
     PriorPage.Enabled = true;
     NextPage.Enabled = true;
     LastPage.Enabled = true;
     if (lbCurrentPage.Text == "1")
     {
         FirstPage.Enabled = false;
         PriorPage.Enabled = false;
     }
     if (lbCurrentPage.Text == ps.PageCount.ToString())
     {
         NextPage.Enabled = false;
         LastPage.Enabled = false;
     }
     AreafactRepeater.DataSource = ps;
     AreafactRepeater.DataBind();
 }
开发者ID:wakaoyun,项目名称:dengqibin,代码行数:25,代码来源:AreaAfact.aspx.cs

示例15: aa

        /*    protected void Page_Init(object sender, EventArgs e)
        {
            this.gp.Attributes.Add("onchange", Page.ClientScript.GetPostBackEventReference(this.gp, "onchange"));
        }
        */
        public void aa()
        {
            string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["TtNum"].ConnectionString;
            SqlConnection conn = new SqlConnection(connectionString);

            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("select * from GoodSort", conn);
            DataSet ds = new DataSet();
            try
            {
                conn.Open();
                da.Fill(ds, "GoodSort");
                conn.Close();
            }
            catch (SqlException e2)
            {
                Response.Write(e2.ToString());
            }
            PagedDataSource obj = new PagedDataSource();
            obj.DataSource = ds.Tables["GoodSort"].DefaultView;
            DropDownList1.DataSource = obj;

            this.DropDownList1.DataTextField = "Sort_name";
            this.DropDownList1.DataValueField = "Sort_ID";
            this.DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, new ListItem("--请选择--"));
            DropDownList2.Items.Insert(0, new ListItem("--请选择--"));
        }
开发者ID:JJDJJ,项目名称:TtNum,代码行数:33,代码来源:add.aspx.cs


注:本文中的System.Web.UI.WebControls.PagedDataSource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。