• 分页控件 代码值得收藏


    前台样式代码

    <webdiyer:AspNetPagerid="AspNetPager1"runat="server"OnPageChanged="AspNetPager1_PageChanged"
    AlwaysShow="true"FirstPageText="首页"LastPageText="尾页"NextPageText="下一页"PrevPageText="上一页"
    NumericButtonCount="6"CssClass="paginator"CurrentPageButtonClass="cpd">
    </webdiyer:AspNetPager>

    C#代码
    protectedvoidBindData()
    {
    PagedDataSource pds =newPagedDataSource();
    //用表格视图作为PagedDataSource的数据源
    pds.DataSource=this.StrToDataTable().DefaultView;
    pds.AllowPaging=true;
    pds.PageSize=AspNetPager1.PageSize=4;
    AspNetPager1.RecordCount= pds.DataSourceCount;//改变当前索引页号(相当重要)/////////////

    pds.CurrentPageIndex=AspNetPager1.CurrentPageIndex-1;
    //将pds绑定到Repeater控件上
    parentRepeater.DataSource= pds;
    parentRepeater.DataBind();
    }
     
  • 相关阅读:
    HDU 1573: X问题
    HDU 1370: Biorhythms
    Break Number --AtCoder
    Cat Snuke and a Voyage --AtCoder
    Fennec VS. Snuke --AtCoder
    Splitting Pile --AtCoder
    Sharing Cookies --AtCoder
    GLB串
    派(Dispatch)
    你知道那棵杨树底下有什么吗
  • 原文地址:https://www.cnblogs.com/yuloe2012/p/2696967.html
Copyright © 2020-2023  润新知