You just want the error message to be displayed on the default SharePoint error page. Is this an easy
In Microsoft.SharePoint.Utilities.SPUtility there are 2 functions:
There are a few overloads for each and they come in handy when developing custom admin pages or custom lists.
PingBack from http://www.clickandsolve.com/?p=1038
Okay that's easy.
I also read your other post, "'How do I' create a long running operation page (gears page)?".
Now the "tricky" question: How do I combine both SPLongOperation and SPUtility.TransferToSuccess / SPUtility.TransferToError
Basically I have a few cases where a long operation will either succeed or fail. In order to have the best SharePoint integration possible, I would like to make use of the default Success and Error pages.
Until now, I have just been able to redirect to those pages, without having the possibility of passing a custom success/error message however.
hi,
i am having mulitple vs statemachine workflows and mulitple site collections, web parts, in my KM portal.
can you tell em how can i tell me how can i customize the error page for each and every workflow , each and every web part?
it would be great if you provide me in your blog.
thnx
agni
@Dinesh (never saw this)
You can try putting the operation in a try/catch block. When it fails, if the TransferToError doesn't work, you may need to put the the operation.End in the beginning of the catch block and then your TransferToError call. You may also try adding a Response.Clear somewhere in there. No redirection will happen until the response header is sent.
@agnihotri What's a KM portal?
You will need to use a different mechanism to handle error messaging, specifically, you'll want to redirect your users to a page that displays specifically for your error messages--you can pass in values via query string.
The TransferToError function simply sends the user to the default SharePoint error page that has the stack trace with the master page layout.