Exemplo n.º 1
0
        //绑定列表数据
        protected void BindRpt()
        {
            int          totalRecord = 0;                                                                        //总记录条数
            int          pageIndex   = Request["pageindex"] == null ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页码
            int          pageSize    = 15;                                                                       //每页条数
            string       parms       = "";                                                                       //传递给下一页的条件
            string       sql         = GetSql(out parms);                                                        //传递给SQL的查询条件
            UserInfoBll  bll         = new UserInfoBll();
            DataTable    list        = bll.GetList(pageIndex, pageSize, sql, out totalRecord);
            PagingHelper pa          = new PagingHelper(pageIndex, pageSize, totalRecord, "UserList.aspx", parms, 10);

            pagetext = pa.CreatePageHtml();//生成分页html
            if (list != null)
            {
                this.rptList.DataSource = list;
                this.rptList.DataBind();
            }
        }