Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using SPLongOperation() , the scenario is:

Splongoperation operation=new splongoperation();
operation.begin();

try {
  /// all working... 
}
catch(exception excep)
{
  sputility.transfertoerrorpage(excep.message);
}

sputility.tranfsertosuccesspage("DOne");

operation.end(vvv);

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

2 Answers 2

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

 
discard

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.