Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPLongOperation.EndScript method

Informs the server that a lengthy server operation (such as a file transfer) has ended and writes a script to the HTTP output stream.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public void EndScript(
	string strScript
)

Parameters

strScript
Type: System.String

A string that contains the script to write to the HTTP output stream.

The following code example shows how to start a long operation by using a delegate method, and how to end the operation by executing a script.

SPLongOperation.Begin(
    delegate(SPLongOperation longOperation)
    {
        // Do something that takes a long time to complete.
        
        
        // Inform the server that the work is done
        // and execute a script.
        longOperation.EndScript("window.close();");
    }
);
Show:
© 2015 Microsoft