private void RptBind(string where) { //显示所属的首页图片 DtCms.BLL.Advertising aBll = new DtCms.BLL.Advertising(); DtCms.Model.Advertising aModel = aBll.GetModel(this.pid); lblAdTitle.Text = "【" + aModel.Id + "】" + aModel.Title + "(" + GetAdTypeName(aModel.AdType.ToString()) + ")"; //绑定首页图片列表 if (!int.TryParse(Request.Params["page"] as string, out this.page)) { this.page = 0; } this.txtKeywords.Text = this.keywords; DtCms.BLL.Adbanner bll = new DtCms.BLL.Adbanner(); //利用PAGEDDAGASOURCE类来分页 PagedDataSource pg = new PagedDataSource(); pg.DataSource = bll.GetList(where).Tables[0].DefaultView; pg.AllowPaging = true; pg.PageSize = pagesize; pg.CurrentPageIndex = page; //获得总条数 pcount = bll.GetCount(where); //绑定数据 rptList.DataSource = pg; rptList.DataBind(); }