分页我的gridview的问题

时间:2009-07-28 21:50:54

标签: c# asp.net visual-studio gridview asp.net-ajax

我在div中有一个gridview,用ajax显示。我有以下内容。

<asp:ImageButton ID="ImageButton2" runat="server" 
                            ImageUrl="~/images/icon_info.gif"  />
                        <div id="moveMe" style="display:none">
                              <div style="float:right;">
                                <asp:LinkButton ID="lnkBtnCloseColHelp" runat="server" Text="X" OnClientClick="return false;" />
                              </div>
                            <br /><br />
                                 <table>
                                 <tr>
                                    <td>
                                         <asp:GridView ID="GridView2" Width="400px" runat="server" AutoGenerateColumns="False"   
                                             AllowPaging ="True"
                                             BackColor="White" BorderColor="#999999" 
                                             BorderStyle="None" BorderWidth="1px" 
                                             CellPadding="3" DataKeyNames="noyb" 
                                             DataSourceID="noyb" 
                                            PagerSettings-Mode="NextPreviousFirstLast">

                                             <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                                             <Columns>
                                                 <asp:BoundField DataField="noyb" HeaderText="App Name" ReadOnly="True" 
                                                     SortExpression="noyb" />
                                                 <asp:BoundField DataField="Description" HeaderText="Short Descr" 
                                                     ReadOnly="True" SortExpression="Description" />
                                                 <asp:BoundField DataField="LongDescription" HeaderText="Long Descr" 
                                                     SortExpression="LongDescription" />
                                             </Columns>
                                             <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                             <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                             <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                             <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                             <AlternatingRowStyle BackColor="#DCDCDC" />
                                             <PagerTemplate>
                                                        <small 12px""="" style="font-size:xx-small; padding-right">Go To Page</small>
                                                        <asp:DropDownList ID="ddlPageSelector" runat="server" AutoPostBack="true" 
                                                            Font-Size="XX-Small" Height="19px" Width="36px">
                                                        </asp:DropDownList>
                                                        <asp:ImageButton ID="btnFirst" runat="server" CommandArgument="First" 
                                                            CommandName="Page" SkinID="pagefirst" />
                                                        <asp:ImageButton ID="btnPrevious" runat="server" CommandArgument="Prev" 
                                                            CommandName="Page" SkinID="pageprev" />
                                                        <asp:ImageButton ID="btnNext" runat="server" CommandArgument="Next" 
                                                            CommandName="Page" SkinID="pagenext" />
                                                        <asp:ImageButton ID="btnLast" runat="server" CommandArgument="Last" 
                                                            CommandName="Page" SkinID="pagelast" />
                                            </PagerTemplate>
                                         </asp:GridView>
                                    </td>

                                </tr>
                                 </table>                         
                        </div>

                        <ajaxToolkit:AnimationExtender ID="ae"
                        runat="server" TargetControlID="ImageButton2" >
                        <Animations>
                           <OnClick>
                              <Sequence>
                                <EnableAction Enabled="false"></EnableAction> 
                                <StyleAction AnimationTarget="moveMe" Attribute="display" Value=""/>
                                <Parallel AnimationTarget="moveMe" Duration="1" Fps="30">
                                    <Move Horizontal="350" Vertical="200"></Move>
                                    <FadeIn Duration=".5"/>
                                </Parallel> 
                                <Parallel AnimationTarget="moveMe" Duration=".5">
                                    <Color PropertyKey="color" StartValue="#666666" EndValue="#0000FF" />
                                    <Color PropertyKey="borderColor" StartValue="#666666" EndValue="#FF0000" />
                                </Parallel>
                            </Sequence>
                            </OnClick>
                        </Animations>
                        </ajaxToolkit:AnimationExtender>
                        <ajaxToolKit:AnimationExtender ID="AnimationExtender2" runat="server" TargetControlID="lnkBtnCloseColHelp">
                        <Animations>
                            <OnClick>
                                <Sequence AnimationTarget="moveMe">
                                    <Parallel AnimationTarget="moveMe" Duration=".7" Fps="20">
                                        <Move Horizontal="350" Vertical="-50"></Move>
                                        <Scale ScaleFactor="0.3" FontUnit="px" />
                                        <Color PropertyKey="color" StartValue="#FF0000" EndValue="#666666" />
                                        <FadeOut />
                                    </Parallel>
                                    <StyleAction Attribute="display" Value="none"/>
                                    <StyleAction Attribute="height" Value=""/>
                                    <StyleAction Attribute="width" Value="400px"/>
                                    <EnableAction AnimationTarget="ImageButton2" Enabled="true" />
                                </Sequence>
                            </OnClick> 
                        </Animations> 
                        </ajaxToolKit:AnimationExtender> 

为什么我不能再翻页?

1 个答案:

答案 0 :(得分:1)

只是想一想......也许你需要在ajax更新面板中使用GridView。