文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>AspNetPager分页

AspNetPager分页

时间:2010-11-15  来源:许雪林

 

代码 <webdiyer:AspNetPager ID="AspNetPager1" runat="server" BackColor="#EEEEEE" 
    CenterCurrentPageButton="True" 
    CustomInfoHTML="共%PageCount%页,当前为第%CurrentPageIndex%页,每页%PageSize%条" 
    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" 
    onpagechanging="AspNetPager1_PageChanging" PageIndexBoxType="DropDownList" 
    PageSize="20" PrevPageText="上一页" ShowCustomInfoSection="Left" 
    ShowPageIndexBox="Always" SubmitButtonText="Go" TextAfterPageIndexBox="页" 
    TextBeforePageIndexBox="转到">
</webdiyer:AspNetPager>

 

 

后台:

 

代码  protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            Bind();
        }
      
    }

    public void Bind()
    {
        user l = new user();
        List<user> m = l.GetList();
        AspNetPager1.RecordCount = m.Count;
        PagedDataSource pds = new PagedDataSource();
        pds.AllowPaging = true;
        pds.PageSize = AspNetPager1.PageSize;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.DataSource = m;
        grdY_user.DataSource = pds;
        grdY_user.DataBind();
    }
    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        this.AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        Bind();
    }

 

 

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载