Skip to content

Commit 4fe10ae

Browse files
authored
Update call-javascript-from-dotnet.md (#36289)
1 parent 7b09a2f commit 4fe10ae

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to invoke JavaScript functions from .NET methods in Blazo
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: wpickett
77
ms.custom: mvc, sfi-ropc-nochange
8-
ms.date: 4/10/2024
8+
ms.date: 11/02/2025
99
uid: blazor/js-interop/call-javascript-from-dotnet
1010
---
1111
# Call JavaScript functions from .NET methods in ASP.NET Core Blazor
@@ -132,7 +132,10 @@ Provide a `displayTickerAlert1` JS function. The function is called with <xref:M
132132
133133
### Component (`.razor`) example (`InvokeVoidAsync`)
134134

135-
`TickerChanged` calls the `handleTickerChanged1` method in the following component.
135+
The following component:
136+
137+
* Invokes the `displayTickerAlert1` JS function with <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync%2A> with two JSON-serializable parameters, a string in `stockSymbol` and a decimal in `price`, when selecting a button (**`Set Stock`**).
138+
* The JS function receives the two arguments in strictly-typed parameters and displays a modal alert box with a specified message.
136139

137140
:::moniker range=">= aspnetcore-9.0"
138141

@@ -222,7 +225,7 @@ Provide a `displayTickerAlert1` JS function. The function is called with <xref:M
222225

223226
:::moniker-end
224227

225-
`TickerChanged` calls the `handleTickerChanged1` method in the following component.
228+
`TickerChanged` calls the `displayTickerAlert1` method in the following component.
226229

227230
:::moniker range=">= aspnetcore-9.0"
228231

@@ -296,7 +299,10 @@ Provide a `displayTickerAlert2` JS function. The following example returns a str
296299
297300
### Component (`.razor`) example (`InvokeAsync`)
298301

299-
`TickerChanged` calls the `handleTickerChanged2` method and displays the returned string in the following component.
302+
The following component:
303+
304+
* Invokes the `displayTickerAlert2` JS function with <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync%2A> with two JSON-serializable parameters, a string in `stockSymbol` and a decimal in `price`, when selecting a button (**`Set Stock`**).
305+
* The JS function receives the two arguments in strictly-typed parameters and displays a modal alert box with a specified message.
300306

301307
:::moniker range=">= aspnetcore-9.0"
302308

@@ -386,7 +392,7 @@ Provide a `displayTickerAlert2` JS function. The following example returns a str
386392

387393
:::moniker-end
388394

389-
`TickerChanged` calls the `handleTickerChanged2` method and displays the returned string in the following component.
395+
`TickerChanged` calls the `displayTickerAlert2` method and displays the returned string in the following component.
390396

391397
:::moniker range=">= aspnetcore-9.0"
392398

0 commit comments

Comments
 (0)