From aaa35bd41018438a06061690b62ec85f01f5d928 Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Thu, 24 Oct 2024 00:39:20 +0200 Subject: [PATCH 1/3] [Blazor] Calling .NET from JS - explanation scenarios for DotNetObjectReference and instance methods --- .../call-dotnet-from-javascript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md index 41a8f726c6be..48bffbf1b2b6 100644 --- a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md +++ b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md @@ -1169,7 +1169,7 @@ In the preceding example: ## Component instance .NET method helper class -A helper class can invoke a .NET instance method as an . Helper classes are useful in the following scenarios: +A helper class can invoke a .NET instance method as an . Helper classes are useful in scenarios where using static .NET methods is not applicable: * When several components of the same type are rendered on the same page. * In server-side apps with multiple users concurrently using the same component. @@ -1345,7 +1345,7 @@ The assignment of a to a proper * In the component's [`OnAfterRender{Async}` method](xref:blazor/components/lifecycle#after-component-render-onafterrenderasync), a JavaScript (JS) function is invoked with the element reference and the component instance as a . The JS function attaches the to the element in a property. * When an element event is invoked in JS (for example, `onclick`), the element's attached is used to call a .NET method. -Similar to the approach described in the [Component instance .NET method helper class](#component-instance-net-method-helper-class) section, this approach is useful in the following scenarios: +Similar to the approach described in the [Component instance .NET method helper class](#component-instance-net-method-helper-class) section, this approach is useful in scenarios where using static .NET methods is not applicable: * When several components of the same type are rendered on the same page. * In server-side apps with multiple users concurrently using the same component. From 6bd4e1f03fd943bf7dc0284d731d0996522bb543 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:14:46 -0400 Subject: [PATCH 2/3] Apply suggestions from code review --- .../call-dotnet-from-javascript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md index 48bffbf1b2b6..57b45be8426e 100644 --- a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md +++ b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md @@ -1169,7 +1169,7 @@ In the preceding example: ## Component instance .NET method helper class -A helper class can invoke a .NET instance method as an . Helper classes are useful in scenarios where using static .NET methods is not applicable: +A helper class can invoke a .NET instance method as an . Helper classes are useful in scenarios where using static .NET methods aren't applicable: * When several components of the same type are rendered on the same page. * In server-side apps with multiple users concurrently using the same component. @@ -1345,7 +1345,7 @@ The assignment of a to a proper * In the component's [`OnAfterRender{Async}` method](xref:blazor/components/lifecycle#after-component-render-onafterrenderasync), a JavaScript (JS) function is invoked with the element reference and the component instance as a . The JS function attaches the to the element in a property. * When an element event is invoked in JS (for example, `onclick`), the element's attached is used to call a .NET method. -Similar to the approach described in the [Component instance .NET method helper class](#component-instance-net-method-helper-class) section, this approach is useful in scenarios where using static .NET methods is not applicable: +Similar to the approach described in the [Component instance .NET method helper class](#component-instance-net-method-helper-class) section, this approach is useful in scenarios where using static .NET methods aren't applicable: * When several components of the same type are rendered on the same page. * In server-side apps with multiple users concurrently using the same component. From 69891ff038e57cba846d7b20bf89ff7c27bf5d02 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:15:57 -0400 Subject: [PATCH 3/3] Update Line 1179 --- .../javascript-interoperability/call-dotnet-from-javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md index 57b45be8426e..707fab043e1a 100644 --- a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md +++ b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md @@ -1176,7 +1176,7 @@ A helper class can invoke a .NET instance method as an . Hel In the following example: -* The component contains several `ListItem1` components, which is a shared component in the app's `Shared` folder. +* The component contains several `ListItem1` components. * Each `ListItem1` component is composed of a message and a button. * When a `ListItem1` component button is selected, that `ListItem1`'s `UpdateMessage` method changes the list item text and hides the button.