The topic is interrupted
Bad solution uses
Response.Redirect(URL, False)
which will result in the non- current page Response.End (), however this can lead to problems because the rest of the page will executeand can cause login bypass and similar security and performance issues.
Edit: Obviously you are not using Response.Redirect and you cannot catch the AbortThreadExecution with Try Catch, which means that now this answer is completely useless :)
To get an answer, though, you need to learn how to ask a question. you need to provide information such as:
- Exception details
- When is it, what are the symptoms
- What have you tried and didn't work?
- Are you dealing with isolation issues?
source to share
Error : The topic was interrupted. at System.Threading.Thread.AbortInternal () at System.Threading.Thread.Abort (Object stateInfo) at System.Web.HttpResponse.End ()
This error occurs mainly if you are using Response.End, Response.Redirect or Server.Transfer
Cause : The Response.End method ends execution of the page and transfers execution to the Application_EndRequest event in the application event pipeline. The line of code that follows Response.End is not executed.
This issue occurs in the Response.Redirect and Server.Transfer methods because both methods call Response.End internally.
Resolution / Decision
You can use try-catch statement to throw this exception
or
For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead of Response.End to bypass code execution in the Application_EndRequest event. For Response.Redirect, use the Response.Redirect (String url, bool endResponse) overload, which passes false for the endResponse parameter to suppress the internal call to Response.End. For example: ex: Response.Redirect ("nextpage.aspx", false); If you use this workaround, the code following Response.Redirect is executed. For Server.Transfer, use the Server.Execute method instead.
source to share