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

I have a question regarding SPLongOperation.

Basically i'm using it while some actions are happening, and if everything goes well it should redirect user to an other page, but if something goes wrong an error or something, it should stay on the same page and show error message.

Any idea how can i manually break SPLongOperation?

And how can i stop redirecting if error occured?

Note: im using sharepoint 2007

I have something like this:

using (SPLongOperation operation = new SPLongOperation(this.Page))

                //SOME ACTIONS               

share|improve this question
up vote 1 down vote accepted

when you do operation.End() there is redirection to specified page done by MS SharePoint (see image).

Long operation end operation

What I can advise is to construct your URL to the same page when error occured using error query parameter and on postback check if error parameter is passed and display error or do whatever you have to. In this way you will "stay on the same page" and treat occured error.

Hope it helps,


share|improve this answer

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.