【发布时间】:2011-08-14 21:33:26
【问题描述】:
我想要的是这种类型的分页结构。
我可以使用下面的代码显示上一个和下一个按钮,它们也很实用。
<PagerTemplate>
<asp:LinkButton CommandName="Page" CommandArgument="Prev" ID="LinkButton2" runat="server" Style="color: Black">
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/videos_page_arrow_previous.gif"/>
</asp:LinkButton>
[Records <%= gridviewVideos.PageIndex * gridviewVideos.PageSize%>-<%= gridviewVideos.PageIndex * gridviewVideos.PageSize + gridviewVideos.PageSize - 1%>]
<asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server" Style="color: Black">
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/videos_page_arrow_next.gif"/>
</asp:LinkButton>
</PagerTemplate>
但我不确定如何在它们之间获取页码。我的每页包含 5 行,如果我使用中继器控件来执行此操作,那么如何?
【问题讨论】:
标签: c# asp.net gridview pagination