<PagerTemplate>
            <table width="100%" id="table">
                <tr>
                   <td style="text-align: center">
                        第<asp:Label ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' ForeColor="red" />页
                        共<asp:Label ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' />页
                        <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandArgument="First"
                        Visible="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"   CommandName="Page" Text="首页" />
                        <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandArgument="Prev" 
                        Visible="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>" CommandName="Page" Text="上一页" />
                        <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandArgument="Next"
                        Visible="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>" CommandName="Page" Text="下一页" />
                        <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandArgument="Last"
                        Visible="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>" CommandName="Page" Text="尾页" />
                        转到<asp:TextBox runat="server" ID="txtSelectPage" Width = "20"></asp:TextBox>页<asp:ImageButton  ImageUrl="~/www/img/go_an.png" runat="server"  ID="ImageButton2" OnClick="ImageButton2_Click"/>
                  </td>
                </tr>
            </table>`
        </PagerTemplate>
这是我的HTML内代码。如何作GO跳转!谢谢各位的帮忙!

解决方案 »

  1.   

    在ImageButton2_Click事件里        Dim iPage As Integer
            iPage = Val(txtSelectPage.Text)
            If iPage < GridView.PageCount + 1 And iPage > 0 Then
                GridView.PageIndex = iPage - 1
            End If
            BindGrid()
      

  2.   

    GridView1.Pageindex=dropdownList.selectedValue;
      

  3.   


    GridView1.Pageindex=dropdownList.selectedValue;呵呵  在减个1就对了!
      

  4.   

    如此简单的问题,,自己下载一个 aspnetpage 7.1控件去,,很简单可以实现