GrideView 分页

来源:互联网 发布:乳晕变大,知乎 编辑:程序博客网 时间:2024/06/05 03:16

    <PagerTemplate>
                 <table style="font-size:12px;" width="100%">
                     <tr>
                         <td style="text-align: right; width:40%;">
                             &nbsp;</td>
                         <td style="text-align: right; ">
                             <asp:Literal ID="Literal_The" runat="server" meta:resourceKey="Literal_TheResource1"
                                 Text="The"></asp:Literal>
                             <asp:Label ID="lblPageIndex" runat="server"
                                 meta:resourceKey="lblPageIndexResource1"
                                 Text="<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>"></asp:Label>
                             <asp:Literal ID="Literal_PT" runat="server" meta:resourceKey="Literal_PTResource1"
                                 Text="Page/Total"></asp:Literal>
                             <asp:Label ID="lblPageCount" runat="server"
                                 meta:resourceKey="lblPageCountResource1"
                                 Text="<%# ((GridView)Container.Parent.Parent).PageCount %>"></asp:Label>
                             <asp:Literal ID="Literal_P" runat="server" meta:resourceKey="Literal_PResource1"
                                 Text="Page"></asp:Literal>
                             &nbsp;&nbsp;</td>
                         <td style="text-align: right; ">
                             <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False"
                                 CommandArgument="first" CommandName="Page" meta:resourceKey="btnFirstResource1"
                                 OnClick="btnFirst_Click" Text="First"></asp:LinkButton>
                         </td>
                         <td style="text-align: right; ">
                             <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False"
                                 CommandArgument="prev" CommandName="Page" meta:resourceKey="btnPrevResource1"
                                 OnClick="btnFirst_Click" Text="Previous"></asp:LinkButton>
                         </td>
                         <td style="text-align: right; ">
                             <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False"
                                 CommandArgument="next" CommandName="Page" meta:resourceKey="btnNextResource1"
                                 OnClick="btnFirst_Click" Text="Next"></asp:LinkButton>
                         </td>
                         <td style="text-align: right; ">
                             <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False"
                                 CommandArgument="last" CommandName="Page" meta:resourceKey="btnLastResource1"
                                 OnClick="btnFirst_Click" Text="End"></asp:LinkButton>
                         </td>
                         <td>
                             <asp:TextBox ID="txtNewPageIndex" runat="server" AutoPostBack="True"
                                 meta:resourceKey="txtNewPageIndexResource1" 
                                 Text="<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>" Width="20px"></asp:TextBox>
                         </td>
                         <td style="text-align: right; width:15px; ">
                             <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False"
                                 CommandArgument="go" CommandName="Page" meta:resourceKey="btnGoResource1"
                                 OnClick="btnFirst_Click" Text="GO"></asp:LinkButton>
                         </td>
                     </tr>
                 </table>
             </PagerTemplate> 

 

 

 

 

 

 

Literal_TheResource1.Text   The

Literal_PTResource1.Text            Page/Total

Literal_PResource1.Text        Page

btnFirstResource1.Text        First

btnPrevResource1.Text                   Previous

btnNextResource1.Text                     Next

btnLastResource1.Text                    End

btnGoResource1.Text                 Go