分页控件使用方法

前台代码:

<%@ Register TagPrefix="cc1" Namespace="Sxmobi.Pager" Assembly="Sxmobi.Pager" %>

    <cc1:SXHPager ID="GridPager1" runat="server"></cc1:SXHPager>

<asp:GridView ID="gv" runat="server">

..........................

</asp:GridView>

     <cc1:SXHPager ID="GridPager2" runat="server"></cc1:SXHPager>

后台代码:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (GridPager1.IsNavigating)
        {
            BindData();
        }
    }

 

 void BindData()
    {
        GridPager2.CurrentPageIndex = GridPager1.CurrentPageIndex;
        ......................

        GridPager1.RecordCount = recordCount;
        GridPager2.RecordCount = recordCount;

        gv.DataBind();

}

 

控件下载地址:http://download.csdn.net/detail/dasihg/4176107

你可能感兴趣的:(分页)