HttpContext.ThreadAbortOnTimeout 属性
定义
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
属性值
如果在线程超时时调用 Abort(),则为 true
;否则为 false
。true
if Abort() will be called when the thread times out; otherwise, false
. 默认值为 true
。The default is true
.
注解
在使用属性实现协作取消的处理程序和模块中 HttpRequest.TimedOutToken ,你可能希望禁用在请求超 Thread.Abort 时时 ASP.NET 默认执行的行为。如果将此属性设置为, false
则可帮助您确保在不中断 ASP.NET 的情况下运行取消和清理例程。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.
如果将此属性设置为 false
,则在发生超时时,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.