2012-06-15 86 views
-2

我有一个长时间运行的方法,可能需要一分钟。在我的本地,没关系,但在服务器上,我得到了一个504响应。我认为这意味着页面超时。是否需要在web.config中更改SessionState?我尝试过,但没有帮助。增加ASP.NET页面超时

什么是增加页面超时的属性?

谢谢。

+2

老兄,你需要学习如何使用谷歌。 –

回答

7

这应该可以解决您的问题。
在web.config把

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

这里是source

+0

请注意,它在调试配置中有效。只在发布。所以如果你正在调试,那么这个属性将被忽略。 – demp

1

不,它没有任何关系会话。它与请求超时有关。有一件事可能会发生在Web.config上:

<httpRuntime executionTimeout="600" /> <!-value is in secs--> 
2

您可以利用HttpRuntime设置。我相信你的情况下,你会调整executionTimeout属性(默认情况下我相信是90秒)。

这里是对的httpRuntime设置一个完整的破败:HttpRuntime Element (ASP.Net Settings Schema)

<configuration> 
    <system.web> 
    <httpRuntime maxRequestLength="4000" 
    enable = "True" 
    requestLengthDiskThreshold="512" 
    useFullyQualifiedRedirectUrl="True" 
    executionTimeout="90" 
    versionHeader="1.1.4128"/> 
    </system.web> 
</configuration>