Some SharePoint operations takes too much time to finish. After theses operations finish we need to redirect the user to another page or to the same one. SharePoint object model offers the SPLongOperation class that shows an “In progress page” that can be personalized. This page is similar to the one displayed when creating a new SharePoint site. The code snippet below shows how we can use this class and personalize this page.
1: using (SPLongOperation operation = new SPLongOperation(this.Page))
3: operation.LeadingHTML = "Operation ";
4: operation.TrailingHTML = "Please wait while this operation finishes";
7: // Your code here !