Click or drag to resize

IJsObjectInvokeAsyncT Method (String, Object)

Asynchronously executes the function with the given methodName and the args in the JavaScript object without blocking the current thread.

Namespace:  DotNetBrowser.Js
Assembly:  DotNetBrowser (in DotNetBrowser.dll) Version: 2.25.1
Syntax
C#
Task<T> InvokeAsync<T>(
	string methodName,
	params Object[] args
)

Parameters

methodName
Type: SystemString
The function name.
args
Type: SystemObject
The list of input arguments. The following types are supported: Boolean, Double, String, IJsObject, or Object.

Type Parameters

T
The expected type of the result of the JavaScript function execution.

Return Value

Type: TaskT
The task that can be used to wait for completion and obtain the result of the JavaScript function execution.
Exceptions
ExceptionCondition
ObjectDisposedExceptionThe IJsObject has already been disposed.
ConnectionClosedExceptionThe connection to the Chromium engine is closed.
Remarks
If the function raises an exception, the task will complete with JsException containing an error message that describes the reason of the exception. Same error message will be printed in JavaScript Console.
See Also