GridView自定义导航控件
1 <%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCpagerSet.ascx.cs" Inherits="myControl_UCpagerSet" %>
2 <%@ Import Namespace="System.Data" %>
3 <div>
4 <asp:LinkButton ID="cmdFirstPage" runat="server" CommandName="Page" CommandArgument="First"
5 Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>">首页</asp:LinkButton>
6 <asp:LinkButton ID="cmdPreview" runat="server" CommandArgument="Prev" CommandName="Page"
7 Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>">上一页</asp:LinkButton>
8 <asp:LinkButton ID="LinkButton5" runat="server" CommandName="Page" CommandArgument="<%# ((GridView)Container.Parent.Parent).PageIndex-1 %>"
9 CssClass="number" Visible="<%# ((GridView)Container.Parent.Parent).PageIndex-1>0 %>"><%# ((GridView)Container.Parent.Parent).PageIndex-1 %></asp:LinkButton>
10 <asp:LinkButton ID="LinkButton4" runat="server" CommandName="Page" CommandArgument="<%# ((GridView)Container.Parent.Parent).PageIndex %>"
11 CssClass="number" Visible="<%# ((GridView)Container.Parent.Parent).PageIndex>0 %>"><%# ((GridView)Container.Parent.Parent).PageIndex %></asp:LinkButton>
12 <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>"
13 CssClass="number current" Visible="<%# ((GridView)Container.Parent.Parent).PageIndex+1<=((GridView)Container.Parent.Parent).PageCount %>"><%# ((GridView)Container.Parent.Parent).PageIndex+1 %></asp:LinkButton>
14 <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Page" CommandArgument="<%# ((GridView)Container.Parent.Parent).PageIndex+2 %>"
15 CssClass="number" Visible="<%# ((GridView)Container.Parent.Parent).PageIndex+2<=((GridView)Container.Parent.Parent).PageCount %>"><%# ((GridView)Container.Parent.Parent).PageIndex+2 %></asp:LinkButton>
16 <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="<%# ((GridView)Container.Parent.Parent).PageIndex+3 %>"
17 CssClass="number" Visible="<%# ((GridView)Container.Parent.Parent).PageIndex+3<=((GridView)Container.Parent.Parent).PageCount %>"><%# ((GridView)Container.Parent.Parent).PageIndex+3 %></asp:LinkButton>
18 <asp:LinkButton ID="cmdNext" runat="server" CommandName="Page" CommandArgument="Next"
19 Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>">下一页</asp:LinkButton>
20 <asp:LinkButton ID="cmdLastPage" runat="server" CommandArgument="Last" CommandName="Page"
21 Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>">尾页</asp:LinkButton>
22 第<asp:Label ID="lblcurPage" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>'></asp:Label>页/共<asp:Label
23 ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount %>'></asp:Label>页
24 </div>
编辑器加载中...