InvokeVoidAsync

Learn how to use asynchronous methods without return values to call JavaScript in the Blazor WebAssembly.

We'll cover the following...

The InvokeVoidAsync method is used to invoke a JavaScript function that does not return a value. It invokes the specified JavaScript function asynchronously. This is the InvokeVoidAsync method of IJsRuntime:

Press + to interact
InvokeVoidAsync(string identifier, params object[] args);

The first argument is the identifier for the JavaScript method that is being called, and the second argument is an array of JSON-serializable arguments. The second argument is optional.

In JavaScript, the Document ...