Demo of DataPager
代码
<asp:DataPager ID="MarktetDataPager" runat="server" PagedControlID="MarktetList" PageSize="10">
<Fields>
<asp:TemplatePagerField>
<PagerTemplate>
共<span style="color: #cc3300">
<%# Container.TotalRowCount % Container.PageSize == 0 ? Container.TotalRowCount / Container.PageSize : Container.TotalRowCount / Container.PageSize+1
%></span> 页
</PagerTemplate>
</asp:TemplatePagerField>
<asp:NextPreviousPagerField FirstPageText="|<<" ShowFirstPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField LastPageText=">>|" ShowLastPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
<Fields>
<asp:TemplatePagerField>
<PagerTemplate>
共<span style="color: #cc3300">
<%# Container.TotalRowCount % Container.PageSize == 0 ? Container.TotalRowCount / Container.PageSize : Container.TotalRowCount / Container.PageSize+1
%></span> 页
</PagerTemplate>
</asp:TemplatePagerField>
<asp:NextPreviousPagerField FirstPageText="|<<" ShowFirstPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField LastPageText=">>|" ShowLastPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>