private void RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; this.txtKeywords.Text = this.keywords; //this.ddlcolname.SelectedValue = this.deptid; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); DataTable dt; TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); dt = JpArticle.GetArticlesBycidAnduidAndtitle_sh(this.txtcid.Text, txtKeywords.Text); this.totalCount = dt.Rows.Count; DataTable tempTable = dt.Clone(); for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } rptList.DataSource = tempTable; rptList.DataBind(); //翻页 //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", // this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__"); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); string pageUrl; pageUrl = JpCommon.CombUrlTxt("list_article_sh.aspx", "page={0}&rnd={1}&keywords={2}&cid={3}", "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + ""); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }