Summary: Learn how to write code to mimic the default long-running operations page (the "spinning wheel") in Microsoft Office SharePoint Server 2007 or Windows SharePoint Services 3.0.
Applies to: Microsoft Office SharePoint Server 2007, Windows SharePoint Services 3.0
David Mann, Mann Software
The Long-Running Operation page is familiar to anyone who uses Microsoft Office SharePoint Server 2007. It is called many things (including the spinning gears page and the spinning wheel) but it all comes down to a consistent UI for times when SharePoint Server needs to be doing a lot of work but the user is sitting and waiting. The ability to mimic this default functionality can make your application fit in with the rest of SharePoint Server.
The code for a long-running operation is simple: whatever code you place between your calls to
End constitutes the long-running operation.
using (SPLongOperation operation = new SPLongOperation(this.Page))
operation.LeadingHTML = "Please wait while the operation runs";
operation.TrailingHTML = "";
ProcessResults = "Operation Completed Successfully";
ProcessResults = "An error occurred and was handled.";
this.Context, "result=" +
The heart of the long-running operation happens in between the
.Begin statement and the
.End statement. While any code you place in between these two statements is running, the user sees the long-running operation page. When your work is complete, the
.End statement is responsible for redirecting the user to whichever page you need them to view next—for example, a results page,
settings.aspx, or the next page in a wizard.
Watch the Video
Video Length: 00:07:56
File Size: 11.8 MB WMV