Gridview分页

来源:互联网 发布:Ubuntu无法解析域名 编辑:程序博客网 时间:2024/05/17 17:14

         <PagerTemplate><div style="text-align:center; color:Blue">
      <asp:LinkButton ID="cmdFirstPage" runat="server" CommandName="Page" CommandArgument="First"
       Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>">首页</asp:LinkButton>&nbsp;
      <asp:LinkButton ID="cmdPreview" runat="server" CommandArgument="Prev" CommandName="Page"
       Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>">前一页</asp:LinkButton>&nbsp;
      第<asp:Label ID="lblcurPage" ForeColor="Blue" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1  %>'></asp:Label>页/共<asp:Label
       ID="lblPageCount" ForeColor="blue" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount %>'></asp:Label>页&nbsp;
      <asp:LinkButton ID="cmdNext" runat="server" CommandName="Page" CommandArgument="Next"
       Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>">后一页</asp:LinkButton>&nbsp;
      <asp:LinkButton ID="cmdLastPage" runat="server" CommandArgument="Last" CommandName="Page"
       Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>">尾页</asp:LinkButton>&nbsp;
       &nbsp;<asp:TextBox ID="txtGoPage" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>'
       Width="32px"></asp:TextBox>页&nbsp;<asp:Button ID="Button3" runat="server"
           OnClick="Turn_Click" Text="转到" /></div>
</PagerTemplate>

 

原创粉丝点击