protected void noticeBind() { ax_article bll = new ax_article(); this.rptList_notice.DataSource = bll.GetList(8, " category_id =3 and status=1 ", " sort_id asc, add_time desc"); this.rptList_notice.DataBind(); }
private void TreeBind() { ax_article bll = new ax_article(); DataTable dt = bll.GetList("category_id =1 order by sort_id asc,id desc").Tables[0]; this.ddlCategoryId.Items.Clear(); this.ddlCategoryId.Items.Add(new ListItem("==全部==", "")); foreach (DataRow dr in dt.Rows) { string Id = dr["id"].ToString(); string Title = dr["title"].ToString().Trim(); this.ddlCategoryId.Items.Add(new ListItem(Title, Id)); } }
private void RptBind(string _strWhere, string _orderby) { this.page = AXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; ax_article bll = new ax_article(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("magic_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//绑定记录 public void binddr() { ax_article bll = new ax_article(); string sqlstr = "category_id =1 and status=1 order by sort_id asc, add_time desc"; DataView dv = bll.GetList(sqlstr).Tables[0].DefaultView; PagedDataSource pds = new PagedDataSource(); AspNetPager1.RecordCount = dv.Count; pds.DataSource = dv; pds.AllowPaging = true; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.PageSize = AspNetPager1.PageSize; repCategory.DataSource = pds; repCategory.DataBind(); }