只是提醒自己,怕以后记不得。
在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>
在设计画面中,还可以选择具体是用数字还是用前后来表示。