AspNETpager 分页控件问题

祁乐无穷7 2014-07-04 09:39:11
 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();
}


我这样写了,能实现下一页,但是上一页、首页、尾页,我该怎么实现?
(求大神帮助啊,本人是超级菜鸟。)
...全文
77 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧