28,390
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack){
DataBind();
repeaterDataBind();
}
}
int pageSize = 4;//显示4条记录
int currentPage = 1;//当前页
/// <summary>
/// 绑定DropDownList
/// </summary>
public void DataBind()
{
TStar.Web.Common.BindDropDownList(BLL.SectionBLL.GetSection, this.ddlLsbk, "SectionName", "id", null);
TStar.Web.Common.BindDropDownList(BLL.Global.SystemCode.DtJc_sjlb,this.ddlFbsj,"Mc","Dm",null);
}
//绑定repeater
public void repeaterDataBind()
{
this.AspNetPager1.PageSize = pageSize;
this.AspNetPager1.RecordCount = BLL.ArticleBLL.GetArticleCount();//获得总记录数
this.rptResult.DataSource = BLL.ArticleBLL.GetArticleByPage(currentPage, pageSize);
this.rptResult.DataBind();
}
/// <summary>
/// 点击查询事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnQuery_Click(object sender, EventArgs e)
{
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e )
{
this.rptResult.DataSource = BLL.ArticleBLL.GetArticleByPage(currentPage+1, pageSize);
this.rptResult.DataBind();
}