日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

AspNetPager使用方法(精)

 悟靜 2012-05-13

AspNetPager使用方法:(自己的一些總結(jié),肯定會(huì)有不足的地方,望不吝指教!)

AspNetPager.dll下載的地址 

1、首先引用AspNetPager.dll;

2、在所使用的前臺(tái)頁(yè)面加入:<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>,

    指明DLL地址和命名空間;

3、在頁(yè)面使用aspnetPager控件:(根據(jù)情況,自定義下面的屬性)

<webdiyer:AspNetPager ID="AspNetPager1" class="quotes" runat="server" CustomInfoHTML="<span class="pageDesc">共有 %RecordCount% 頁(yè) %CurrentPageIndex% / %PageCount% 頁(yè)</span>"
                        FirstPageText="首頁(yè)" LastPageText="尾頁(yè)" NextPageText="下一頁(yè)" PrevPageText="上一頁(yè)" Width="95%"
                        CustomInfoStyle="" PagingButtonsClass="PageButton" AlwaysShowFirstLastPageNumber="True"
                        CurrentPageButtonClass="PageButtonCurrent" PagingButtonSpacing="2px" PagingButtonsStyle=""
                        ShowPageIndexBox="Never" CurrentPageButtonStyle="" LayoutType="Table" OnPageChanging="AspNetPager1_PageChanging"
                        ShowCustomInfoSection="Left">
                    </webdiyer:AspNetPager>

 標(biāo)紅的是點(diǎn)擊觸發(fā)事件:

       在.cs后臺(tái)頁(yè)面加上此方法:

        protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;//指定顯示的頁(yè)數(shù)
        }

4、同時(shí),還要指定以下值: 

      AspNetPager1.PageSize=10;//每頁(yè)顯示多少條記錄

      AspNetPager1.RecordCount=100;//總頁(yè)數(shù)

5、因?yàn)樵摽丶c數(shù)據(jù)顯示和綁定是獨(dú)立的,所以可以根據(jù)所要顯示的頁(yè)數(shù)AspNetPager1.CurrentPageIndex,取得該頁(yè)數(shù)據(jù)datatable,然后再使用repeater等控件綁定:

      Repeater1.DataSource = dt;
      Repeater1.DataBind();

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多