HttpServerUtility.ScriptTimeout Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets and sets the request time-out value in seconds.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

public int ScriptTimeout {
	get;
	[AspNetHostingPermissionAttribute(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Medium)]
	set;
}

Property Value

Type: System.Int32

The time-out value setting for requests.

Exception Condition
HttpException

The current HttpContext is null.

ArgumentOutOfRangeException

The time-out period is null or otherwise could not be set.

The ScriptTimeout property can be set in the Web.config file by setting the executionTimeout attribute of the element. Setting the time-out programmatically with the ScriptTimeout property takes precedence over the Web.config setting.

System_CAPS_noteNote

If you set the debug attribute of the element to true in the Web.config file, the value of ScriptTimeout will be ignored.

The following example sets the request time-out period to 60 seconds.

Server.ScriptTimeout = 60;

.NET Framework
Available since 1.1
Return to top
Show: