HttpContext.ThreadAbortOnTimeout HttpContext.ThreadAbortOnTimeout HttpContext.ThreadAbortOnTimeout HttpContext.ThreadAbortOnTimeout Property

Definition

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

public:
 property bool ThreadAbortOnTimeout { bool get(); void set(bool value); };
public bool ThreadAbortOnTimeout { get; set; }
member this.ThreadAbortOnTimeout : bool with get, set
Public Property ThreadAbortOnTimeout As Boolean
Property Value

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

Remarks

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.

Applies to