You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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
132
132
133
133
### Component (`.razor`) example (`InvokeVoidAsync`)
134
134
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.
136
139
137
140
:::moniker range=">= aspnetcore-9.0"
138
141
@@ -222,7 +225,7 @@ Provide a `displayTickerAlert1` JS function. The function is called with <xref:M
222
225
223
226
:::moniker-end
224
227
225
-
`TickerChanged` calls the `handleTickerChanged1` method in the following component.
228
+
`TickerChanged` calls the `displayTickerAlert1` method in the following component.
226
229
227
230
:::moniker range=">= aspnetcore-9.0"
228
231
@@ -296,7 +299,10 @@ Provide a `displayTickerAlert2` JS function. The following example returns a str
296
299
297
300
### Component (`.razor`) example (`InvokeAsync`)
298
301
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.
300
306
301
307
:::moniker range=">= aspnetcore-9.0"
302
308
@@ -386,7 +392,7 @@ Provide a `displayTickerAlert2` JS function. The following example returns a str
386
392
387
393
:::moniker-end
388
394
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.
0 commit comments