'How do I' create a long running operation page (gears page)?

This one is an awesome feature to add if you've got an application running a workflow asynchronously and on-the-fly (see post on programmatically launching a workflow) and you want to coordinate the results of said workflow synchronously, so.you have to wait for the workflow to complete.

image

Check out Microsoft.SharePoint.SPLongOperation. This object allows you to begin and complete the long operation quite easily.

SPLongOperation operation = new SPLongOperation(this) {  LeadingHTML = "This is a bold description of my operation",  TrailingHTML = "This is a normal sub-description of my operation"};operation.Begin();Thread.Sleep(5000);operation.End("/redirectpage.aspx");