在运行时更改执行超时

时间:2013-08-23 20:48:23

标签: asp.net iis configuration .net-3.5 runtime

在某些情况下,我们在ASP.NET中构建报告,我需要几分钟才能构建 - 比默认执行超时更长。是否可以在运行时和/或特定页面[和/或特定Web服务方法]更改超时?

我们已经尝试HttpRuntimeSection.ExecutionTimeout无效(在运行时抛出异常The configuration is read only.)。

2 个答案:

答案 0 :(得分:1)

您可以在Web配置文件中调整所需页面的超时

<location path="somefile.aspx">
    <system.web>
        <httpRuntime executionTimeout="180"/>
    <system.web/>
<location/>

答案 1 :(得分:1)

Server.ScriptTimeout似乎正在为我们做这个伎俩:

Server.ScriptTimeout = 600;