Article ID: 817266 - Last Review: May 5, 2003 - Revision: 1.3 PRB: System.Threading.ThreadAbortException Error Message When You Use Server.Transfer in HTTPHandler in an ASP.NET ApplicationOn This PageSYMPTOMSWhen you use a Server.Transfer method in HTTPHandler to transfer the control from one page to another in an
ASP.NET Web application, you
may receive the following error message: System.Threading.ThreadAbortException: Thread was being
aborted. at System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort() at System.Threading.Thread.Abort(Object
stateInfo) at System.Web.HttpResponse.End() at
System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) CAUSEWhen you call Server.Transfer, ASP.NET internally calls
the Server.Execute method to transfer the control, and calls the Response.End method to end the processing
of the current page. Response.End ends the page execution and calls
the Thread.Abort method. The Thread.Abort method causes the ThreadAbortException error message to appear. WORKAROUNDTo work around this problem, use Server.Execute instead of
Server.Transfer in the ProcessRequest method of HTTPHandler. The modified
ProcessRequest method is as follows: Visual C# .NET Sample Code STATUS This
behavior is by design. MORE INFORMATIONSteps to Reproduce the Behavior
REFERENCES For additional information,
click the following article numbers to view the articles in the Microsoft
Knowledge Base: 312629
(http://support.microsoft.com/kb/312629/EN-US/
)
PRB: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer
320439
(http://support.microsoft.com/kb/320439/EN-US/
)
PRB: "Error Executing Child Request" Error Message When You Use Server.Transfer or Server.Execute in ASP.NET Page
224363
(http://support.microsoft.com/kb/224363/EN-US/
)
Using the Server.Execute Method
| Article Translations
|

Back to the top
