HttpServerUtility.ScriptTimeout Property


取得或設定要求的逾時值 (以秒為單位)。Gets or sets the request time-out value in seconds.

 property int ScriptTimeout { int get(); void set(int value); };
public int ScriptTimeout { get; set; }
member this.ScriptTimeout : int with get, set
Public Property ScriptTimeout As Integer

Property Value


要求的逾時值設定。The time-out value setting for requests.


目前的 HttpContextnullThe current HttpContext is null.

逾時期間為 null,否則不能被設定。The time-out period is null or otherwise could not be set.


下列範例會將要求超時期限設定為60秒。The following example sets the request time-out period to 60 seconds.

Server.ScriptTimeout = 60;

Server.ScriptTimeout = 60


您可以藉由設定HTTPRuntime元素的 executionTimeout 屬性,在 web.config 檔案中設定 ScriptTimeout 屬性。The ScriptTimeout property can be set in the Web.config file by setting the executionTimeout attribute of the httpRuntime element. 以程式設計方式使用 ScriptTimeout 屬性設定超時時間,會優先于 Web.config 設定。Setting the time-out programmatically with the ScriptTimeout property takes precedence over the Web.config setting.


如果您將HTTPRuntime元素的 debug 屬性設定為 web.config 檔案中 true,則會忽略 ScriptTimeout 的值。If you set the debug attribute of the httpRuntime element to true in the Web.config file, the value of ScriptTimeout will be ignored.

Applies to