コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UsersBll ub = new UsersBll();

            string index = Request["index"];

            if (string.IsNullOrEmpty(index))
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(index);
            }
            //总页数
            int total = ub.GetRecordCount("");

            pageCount = Convert.ToInt32(Math.Ceiling((double)total / pageSize));
            //集合
            DataSet ds = ub.GetListByPage("", "id", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex);

            userList = ub.DataTableToList(ds.Tables[0]);
        }