SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Wherever I use SPUtility.Redirect in my code it works ok for the user but i see a thread abort exception in the ULS logs, the message starts with:

"ExceptionType: 'ThreadAbortException' ExceptionMessage: 'Thread was being aborted.')"

Then a few lines later in ULS i see a host of request not disposed entries starting wtih:

"An SPRequest object was not disposed before the end of this thread"

I have seen other poeple reporting the ThreadAbortException on the internet, but no one has been able to explain why this happens, or how to use SPUtility.Redirect in such a way that the exception isn't thrown. Whilst Response.Redirect(url,false) doesn't raise an exception, i still see the entries reporting that the SPRequest wasn't disposed properly. Hope you can help

share|improve this question

There's an answer on technet which explains it pretty well:


When request is being redirected, the HttpResponse.End() method is called. The given method, in turn, calls

Thread.CurrentThread.Abort(new HttpApplication.CancelModuleException(false));

The Thread.Abort method raises ThreadAbortException in the thread where it is invoked to begin the process of terminating the thread. I mentioned about that in my blog post. So it's normal behavior.

Try to use SPRedirectFlags.DoNotEndResponse when calling SPUtility.Redirect().

share|improve this answer
Thank you for this, the correct solution and an explanation of the issue. I couldn't ask for more. Edit: I know this is just pointing to another article but Google brought me here. – Vinnyq12 Jul 5 '13 at 8:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.