HttpContext::ThreadAbortOnTimeout Property

.NET Framework (current version)

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

Gets or sets a value that specifies whether the ASP.NET runtime should call Thread::Abort on the thread that is servicing this request when the request times out.

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

property bool ThreadAbortOnTimeout {
	bool get();
	void set(bool value);

Property Value

Type: System::Boolean

true if Thread::Abort will be called when the thread times out; otherwise, false. The default is true.

In handlers and modules that are using the HttpRequest::TimedOutToken property to implement cooperative cancellation, you might wish to disable the Thread::Abort behavior that ASP.NET performs by default when a request times out. Setting this property to false can help you make sure that cancellation and cleanup routines will run without being interrupted by ASP.NET.

If you set this property to false, ASP.NET will not automatically display a "Request timed out" error page when a timeout occurs. The application is responsible for setting the response content appropriately.

.NET Framework
Available since 4.5
Return to top