UserControlPage.ascx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:5k
- <%@ control language="C#" autoeventwireup="true" inherits="UserControl_UserControlPage, App_Web_e5wuhoiu" %>
- <script type="text/javascript">
- function callButtonEvent()
- {
- var keycode =window.event.keyCode;
- if(keycode==13)
- {
- if(check()==true)
- {
- event.cancelBubble=true;
- event.returnValue=false;
- document.getElementById('<%=btnGo.ClientID%>').click();
- }
- }
- }
- function check()
- {
- var count = parseInt(document.getElementById('<%=ltTotal.ClientID%>').outerText);
- // document.getElementById('<%=labOf.ClientID%>').outerText;
- var txt = document.getElementById('<%=txtCurrentPage.ClientID%>').value;
- var cur = parseInt(txt);
- if (cur > count || cur < 1)
- {
- alert('系统提示:数字超出实际范围!');
- event.cancelPostBack=true;
- return false;
- }
- if ((cur | NaN) ==0)
- {
- alert('系统提示:请输入数字!');
- event.cancelPostBack=true;
- return false;
- }
- }
- </script>
- <table id="Table1" cellpadding="0" cellspacing="0" width="100%" border="0" style="font-size:12px;">
- <colgroup>
- <%--<col width="400">
- <col width="50">
- <col width="50">
- <col width="40">
- <col width="20">
- <col width="40">
- <col width="40">
- <col width="50">
- <col width="70">--%>
- </colgroup>
- <%--<tr>
- <td>
- <asp:Label ID="LabelCurrentPage" runat="server">当前页:<%# ((GridView)Container.NamingContainer).PageIndex + 1 %></asp:Label>
-
- <asp:Label ID="LabelPageCount" runat="server">总页数:<%# ((GridView)Container.NamingContainer).PageCount %></asp:Label>
-
- <asp:LinkButton ID="LinkButtonFirstPage" runat="server" CommandArgument="First" CommandName="Page"
- Enable="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>">首页</asp:LinkButton>
-
- <asp:LinkButton ID="LinkButtonPreviousPage" runat="server" CommandArgument="Prev"
- CommandName="Page" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>">上一页</asp:LinkButton>
-
- <asp:LinkButton ID="LinkButtonNextPage" runat="server" CommandArgument="Next" CommandName="Page"
- Enable="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>">下一页</asp:LinkButton>
-
- <asp:LinkButton ID="LinkButtonLastPage" runat="server" CommandArgument="Last" CommandName="Page"
- Enable="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>">尾页</asp:LinkButton>
- 转到第:<asp:TextBox ID="LinkTextBoxNewPage" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>'
- Width="20px"></asp:TextBox>页
- <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="LinkTextBoxNewPage"
- Display="Dynamic" ErrorMessage="0-99999" MaximumValue="99999" MinimumValue="0"
- ValidationGroup="goto"></asp:RangeValidator>
- <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
- CommandName="Page" Text="GO" ValidationGroup="goto"></asp:LinkButton>
- </td>
- </tr>--%>
-
- <tr align="center">
- <td>
- <ASP:LABEL ID="labOf" RUNAT="server">当前页:</ASP:LABEL><asp:Label ID="lbCurrent" runat="server"></asp:Label>
-
- <ASP:LABEL ID="lblTotal" RUNAT="server">总页数:</ASP:LABEL><asp:Label ID="ltTotal" runat="server"></asp:Label>
-
- <asp:LinkButton id="btnFirstPage" runat="server" CommandArgument="First">第一页</asp:LinkButton>
-
- <asp:LinkButton id="btnPrevPage" runat="server" CommandArgument="Prev">上一页</asp:LinkButton>
-
- <asp:LinkButton id="btnNextPage" runat="server" CommandArgument="Next">下一页</asp:LinkButton>
-
- <asp:LinkButton id="btnLastPage" runat="server" CommandArgument="Last">最后一页</asp:LinkButton>
-
- 跳转至:<ASP:TEXTBOX ID="txtCurrentPage" runat="server" MaxLength="5" Width="40" Height="16">0</ASP:TEXTBOX>
-
- <ASP:LinkButton ID="btnGo" runat="server" text="Go" CommandArgument="Go" CausesValidation="False" ToolTip="转到"></ASP:LinkButton>
-
- </td>
- </tr>
- </table>