更新面板挂起在ASP.NET中,结果为大gridview

更新面板挂起在ASP.NET中,结果为大gridview,asp.net,gridview,updatepanel,Asp.net,Gridview,Updatepanel,在我的代码中,我有一个更新面板,将挂起一个大的结果 <asp:UpdatePanel ID="up1" EnableViewState="false" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div id="tablediv" style="width:1250px;heigh

在我的代码中,我有一个更新面板,将挂起一个大的结果

<asp:UpdatePanel ID="up1" EnableViewState="false" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                            <div id="tablediv" style="width:1250px;height:100%;overflow:hidden;margin: 0px auto 0px auto;padding-top:35px;padding-bottom:15px;">

                                <div class="ScrollableDiv" style="max-height:100%;width:100%;overflow-y:auto;">
                                    <asp:GridView ID="gvResults"
                                        runat="server" 
                                        AlternatingRowStyle-CssClass="AlternateRow" RowStyle-CssClass="MainRow"
                                        AutoGenerateColumns="false"
                                        ShowHeader="false"
                                        DataKeyNames="pomOrdernum"
                                        CellPadding="0"
                                        CellSpacing="0"
                                        GridLines="None"
                                        >.... </asp:Gridview>
...
</ContentTemplate>
.... 
</UpdatePanel>

.... 
...
.... 

我有一个asp:按钮(它是隐藏的,通过javascript单击),按下该按钮后,将对数据进行排序,并使用排序结果更新gridview。对于较大的数据集,这将只是挂起。我发现,当我尝试在更新面板之外提交视图状态的回发时,会出现“请求大小太大”错误。我发现它正在提交我用来跟踪绑定到GridView的DataTable的viewstate,而这个view state元素对于IIS来说太大了。解决此问题的最简单方法是增加web.config中的最大请求长度

   <system.web>
    <sessionState timeout="60"/>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
    <httpRuntime maxRequestLength="50000"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>

  <system.webServer>
    <!--<directoryBrowse enabled="true" showFlags="Date,Time,Extension,Size" />-->
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="51200000" />
      </requestFiltering>
    </security>
  </system.webServer>

我发现,当我尝试在更新面板之外提交视图状态的回发时,会出现“请求大小太大”错误。我发现它正在提交我用来跟踪绑定到GridView的DataTable的viewstate,而这个view state元素对于IIS来说太大了。解决此问题的最简单方法是增加web.config中的最大请求长度

   <system.web>
    <sessionState timeout="60"/>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
    <httpRuntime maxRequestLength="50000"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>

  <system.webServer>
    <!--<directoryBrowse enabled="true" showFlags="Date,Time,Extension,Size" />-->
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="51200000" />
      </requestFiltering>
    </security>
  </system.webServer>