SPLongOperation class Sets the Web page image to the image used by the server to indicate a lengthy operation (typically, an animated image with associated text).
So, when you are starting a workflow, or doing some server side processing that can take long period than asp.net request execution timeout period, you can use this class to do such operations.
1: SPLongOperation.BeginOperation beginOperation = null;
2: if (beginOperation == null)
4: beginOperation = delegate(SPLongOperation longOperation)
6: // Long running code here ...
7: longOperation.End(this.workflowList.DefaultViewUrl, SPRedirectFlags.UseSource, HttpContext.Current, "");
You need to import System.Threading. At the end of your operation, generally you do longOperation.End() and page will be redirected to the specified url. If you are doing it in sharepoint dialog, it will automatically close dialog and redirect parent page.