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               


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,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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