public void BindData(string where) { try { int PageCurrent = Convert.ToInt32(this.AspNetPager1.CurrentPageIndex); int PageNum = 20; int TotalCount = 1; int PageCount = 1; AspNetPager1.PageSize = PageNum; DataTable dt = bll.GetzsWebsiteList("zsWebsite", "Id", "*", where, "Id desc", ref PageCurrent, PageNum, ref TotalCount); if (dt != null) { this.AspNetPager1.RecordCount = Convert.ToInt32(TotalCount); this.Website.DataSource = dt.DefaultView; Website.DataBind(); if (TotalCount % PageNum > 0) { PageCount = TotalCount / PageNum + 1; } else { PageCount = TotalCount / PageNum; } this.pinfo.InnerText = Convert.ToString(TotalCount);//总条数 } } catch (Exception ex) { throw new Exception(ex.Message); } }