Asp.net Gridview分页始终处于打开状态

Asp.net Gridview分页始终处于打开状态,asp.net,gridview,paging,Asp.net,Gridview,Paging,我想在gridview上关闭分页,但是,我似乎无法关闭它,而且我不明白它从何开始 这似乎是一个基本问题,但我似乎找不到任何人有同样的问题。我发现很多人在打开分页时有问题,但没有人关闭它 ASP.Net代码 <asp:TabContainer ID="tcQuestions" runat="server" Width="100%" ActiveTabIndex="2"> <asp:TabPanel ID="tpAll" runat="server" HeaderText=

我想在gridview上关闭分页,但是,我似乎无法关闭它,而且我不明白它从何开始

这似乎是一个基本问题,但我似乎找不到任何人有同样的问题。我发现很多人在打开分页时有问题,但没有人关闭它

ASP.Net代码

<asp:TabContainer ID="tcQuestions" runat="server" Width="100%" ActiveTabIndex="2">
    <asp:TabPanel ID="tpAll" runat="server" HeaderText="All Questions" ScrollBars="None">
        <ContentTemplate>
            <asp:UpdatePanel ID="upAll" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="gvAllQuestions" runat="server" DataSourceID="sdsQuestions" AutoGenerateColumns="False" AllowPaging="False" Width="100%">
                        <Columns>
                            <asp:HyperLinkField DataTextField="QuestionRef" HeaderText="Ref" DataNavigateUrlFields="FkSection,QuestionID" DataNavigateUrlFormatString="questions/{0}/{1}">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </asp:HyperLinkField>
                            <asp:BoundField DataField="QuestionText" HeaderText="Question" />
                            <asp:BoundField DataField="Period" HeaderText="Frequency">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="ValidFrom" HeaderText="Start From" DataFormatString="{0:dd MMM yy}">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="ObsoleteDate" HeaderText="Next Review" DataFormatString="{0:dd MMM yy}">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </asp:BoundField>
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="sdsQuestions" runat="server"
                        ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>"
                        SelectCommand="SELECT QuestionID, QuestionRef, QuestionText, FkSection, Period, ValidFrom, ObsoleteDate FROM Questions WHERE [FkSection] = @SectionID ORDER BY Obsolete, ObsoleteDate Desc">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlSections" Name="SectionID" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </asp:TabPanel>


没有影响gridview的代码隐藏。

尝试将
AllowPaging=false
赋予gridview,并在项目范围内选中搜索
AllowPaging
。@Nadeem-已经尝试过了,谢谢though@TimSchmelter-目的是什么?@Weiz_ell:由于默认情况下
allowpage
off
,并且您的codebehind不包含修改
GridView
的代码,因此剩下的唯一结论是其他地方的一些代码修改了此设置。现在编辑您已经编辑了您的问题,以包括
allowpage=“False”
,这是默认设置,因此不会改变任何内容。