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 am using SPLongOperation() , the scenario is:

Splongoperation operation=new splongoperation();

try {
  /// all working... 
catch(exception excep)



but it is unable to transfer to the error or success page.

Is it possibly to do with the transfer inside splongoperation()?

share|improve this question

Without having tried out the code, it looks to me as if you do a redirect before your transaction has finished. This will end code execution.

Are you aware that you can redirect using the

operation.End("/mysuccesspage.aspx", Microsoft.SharePoint.Utilities.SPRedirectFlags.DoNotEndResponse, HttpContext.Current, "");

to redirect to where you want?

share|improve this answer
i want to redirect to SPUtility.Transfertosuccesspage().. is it possible to redirect to this page with opeartion.End()? – sbtahir Apr 6 '10 at 9:18
Yes, that's possible. Have a look at MBSurf's answer. – Jaap Vossers Jun 1 '10 at 16:19

If you look in the reflector, SPUtility.TransferToSuccessPage has the success page hardcoded to ~/layouts/success.aspx, so you are probably safe in doing

operation.End("success.aspx", SPRedirectFlags.RelativeToLayoutsPage, current, "");

to get to the official success page and have it work with SPLongOperation

share|improve this answer
i ll try this and will let u know. – sbtahir Apr 21 '10 at 6:01

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.