SPLongOperation.EndScript method
冗長的伺服器作業 (例如檔案傳輸) 已結束,且將指令碼至 HTTP 輸出資料流,請通知伺服器。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Sub EndScript ( _
strScript As String _
)
'用途
Dim instance As SPLongOperation
Dim strScript As String
instance.EndScript(strScript)
public void EndScript(
string strScript
)
參數
strScript
Type: System.String字串,包含指令碼寫入至 HTTP 輸出資料流。
Examples
下列程式碼範例示範如何使用委派的方法,來啟動長時間的作業,以及如何藉由執行指令碼結束操作。
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();");
}
);
' Do something that takes a long time to complete.
' Inform the server that the work is done
' and execute a script.
SPLongOperation.Begin(Function(longOperation) AnonymousMethod1(longOperation))
Private Function AnonymousMethod1(ByVal longOperation As SPLongOperation) As Object
longOperation.EndScript("window.close();")
Return Nothing
End Function