现在的位置: 首页 > 综合 > 正文

asp.net中分页控件

2013年09月12日 ⁄ 综合 ⁄ 共 873字 ⁄ 字号 评论关闭

只是提醒自己,怕以后记不得。

在aspx中定义如下,其中pagesize=10是控制每页显示10个,  

 <div  style=" width:1024px; height: 20px;  margin-top:5px;font-size:10pt;text-align:center">
                      <asp:DataPager PagedControlID="lvKoteiList" ID="DataPager1" PageSize="10" runat="server">
                           <Fields>
                                <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True"

                                   FirstPageText="最初"   ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True"

                                    LastPageText="最後"     ShowNextPageButton="False" ShowPreviousPageButton="False" />
                           </Fields>
                      </asp:DataPager>
        </div>

在设计画面中,还可以选择具体是用数字还是用前后来表示。

【上篇】
【下篇】

抱歉!评论已关闭.