asp.net 分页控件

 
                                ID="AspNetPager1" runat="server" AlwaysShow="True" CustomInfoHTML="第%CurrentPageIndex%页,共%PageCount%页,每页%PageSize%条"
                CustomInfoSectionWidth="20%" CustomInfoTextAlign="Center" FirstPageText="首页"
                LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"
                UrlPaging="True" Width="98%" Wrap="False"  BorderColor="ActiveCaptionText"
                                Font-Size="12px" Font-Strikeout="False" Font-Underline="False"
                                BorderWidth="1px" PageSize="12">
           

 

       public void bangdingJPXM()
        {
            DataSet ds = FuZhongBLL.fz_Product.GetList("IsPass=1 and State=1 and Recommend=1");

            AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
            PagedDataSource pds = new PagedDataSource();
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.DataSource = (DataView)ds.Tables[0].DefaultView;

            DataListJPXM.DataSource = pds;
            DataListJPXM.DataBind();

            //DataListJPXM.DataSource = FuZhongBLL.fz_Product.GetList("IsPass=1 and State=1 and Recommend=1");
            //DataListJPXM.DataBind();
        }

 protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
            bangdingJPXM();
        }

你可能感兴趣的:(asp.net 分页控件)