Thread was being aborted, Response.Redirect

Sometimes, trying to handle exceptions with a statement that redirects the page, we may get a ThreadAbortException error.

“If you use the Response.End, Response.Redirect, or Server.Transfer method, a ThreadAbortException exception occurs. You can use a try-catch statement to catch this exception.”

The solution is using these two lines:


Response.Redirect(url,false);
Context.ApplicationInstance.CompleteRequest();

Oficilal solution page from Microsoft:

https://support.microsoft.com/en-us/kb/312629

Advertisements