2012-06-15 84 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>