Skip to content

Commit 4fdd01c

Browse files
authored
Update call-javascript-from-dotnet.md (#35452)
1 parent a9dc43e commit 4fdd01c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ Use `InvokeNew(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop
498498
```csharp
499499
var inProcRuntime = ((IJSInProcessRuntime)JSRuntime);
500500
var classRef = inProcRuntime.InvokeNew("TestClass", "Blazor!");
501-
var text = await classRef.GetValueAsync<string>("text");
502-
var textLength = await classRef.InvokeAsync<int>("getTextLength");
501+
var text = classRef.GetValue<string>("text");
502+
var textLength = classRef.Invoke<int>("getTextLength");
503503
```
504504

505505
An overload is available that takes a <xref:System.Threading.CancellationToken> argument or <xref:System.TimeSpan> timeout argument.

0 commit comments

Comments
 (0)