泰拉瑞亚十字章护盾:简单实用AspNetPager样式

来源:百度文库 编辑:偶看新闻 时间:2024/04/27 22:57:41

分页是Web应用程序中最常用到的功能之一,AspNetPager  简单实用,应用到项目后台中,棒极了!

  自定义样式:

  

  前台:

  

  

  

  

  

  FirstPageText="首页"  LastPageText="尾页" NextPageText="下一页"  PageSize="20" PrevPageText="上一页"  ShowCustomInfoSection="Left"

  ShowInputBox="Never" onpagechanged="AspNetPager1_PageChanged"  CustomInfoTextAlign="Left" LayoutType="Table"  >

  

  

  后台:

  void bindData()

  {       .......绑定语句       this.AspNetPager1.CustomInfoHTML = string.Format("当前第{0}/{1}页 共{2}条记录 每页{3}条", new object[] { this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageCount, this.AspNetPager1.RecordCount, this.AspNetPager1.PageSize });

  }

  protected void AspNetPager1_PageChanged(object src, EventArgs e)

  {

  bindData();

  }