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

1 Answer 1


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().

  • 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, 2013 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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