using webdiyer:AspNetPager(AspNetPager.dll) 收藏
using webdiyer:AspNetPager(AspNetPager.dll) 收藏
1 add the control in aspx page:
<webdiyer:AspNetPager id="AspNetPager1" runat="server" CssClass="hui_01" ShowInputBox="always" ShowPageInfo="before"
HorizontalAlign="center"></webdiyer:AspNetPager>
说明: ShowInputBox 可以出现输入框,指定跳转页面;
2 .cs
DataSet ds = brPager.LoadList(pager,ref allcount);
//allcount 用于接收记录总数
if(dt.Rows.Count>0)
{
this.AspNetPager1.FirstPageText="第一页";
this.AspNetPager1.LastPageText="最后一页";
this.AspNetPager1.NextPageText="下一页";
this.AspNetPager1.PrevPageText="上一页";
this.AspNetPager1.TextBeforePager="记录总数:"+allcount.ToString();
this.AspNetPager1.PageSize=pagesize;
this.AspNetPager1.PageButtonCount=4;
this.AspNetPager1.RecordCount=allcount;
}
3 AspNetPager1 翻页事件 主要是传入要显示的页数
this.AspNetPager1.PageChanged += new Wuqi.Webdiyer.PageChangedEventHandler(this.AspNetPager1_PageChanged);
private void AspNetPager1_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
{
this.AspNetPager1.CurrentPageIndex=e.NewPageIndex;
LoadInfoList(this.getCondition(),e.NewPageIndex);
}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/littlekeen/archive/2005/10/17/505442.aspx