HttpException(0x80004005):请求超时ASP.Net

时间:2014-11-04 06:34:29

标签: c# asp.net web-config timeout

我只是想问一下是否有办法增加特定页面的执行TimeOut?而不是整个申请?

<configuration>    
  <system.web>
   <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" 
minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />
 </system.web>
</configuration>

2 个答案:

答案 0 :(得分:1)

Page.Server.ScriptTimeout = 90;

use location element in config file

<configuration>
  <location path="UploadPage.aspx">
    <system.web>
      <httpRuntime executionTimeout="90" maxRequestLength="4096" />
    </system.web>
  </location>
</configuration>

请参阅To Increase Request Timeout only on particular Web PageIncrease ASP.Net timeout on a per page level

答案 1 :(得分:0)

放入Web配置文件

 <location path="Report.aspx">
    <system.web>
      <httpRuntime executionTimeout="3600" maxRequestLength="10240"/>
    </system.web>
  </location>