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
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
author: tdykstra
3
3
ms.author: wpickett
4
-
ms.date: 09-21-2025
4
+
ms.date: 10-16-2025
5
5
---
6
6
7
7
# Copilot Instructions for `dotnet/AspNetCore.Docs`
@@ -78,10 +78,14 @@ When working on an issue:
78
78
79
79
## Repository-Specific Guidelines
80
80
-[ ] Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
81
+
-[ ] Use contractions following the guidance in [Use contractions](https://learn.microsoft.com/en-us/style-guide/word-choice/use-contractions)
81
82
-[ ]**Repository Exceptions**:
82
83
-[ ] Number ordered lists as "1." for every item (don't use sequential numbers)
83
84
-[ ] Use backticks around content specifically for file names (`file.txt`), folders (`folder`), file paths (`folder/file.txt`), custom types (`myVariable`, `MyClass`), raw URLs in the text (`https://www.contoso.com`), URL segments (`/product/id/199`), file extensions (`.razor`), NuGet packages (`Microsoft.AspNetCore.SignalR.Client`), and code that should never be localized
84
85
-[ ] For Blazor's Razor components mentioned in article text, use backticks around the name of the component (example: `Counter` component)
86
+
-[ ] Use placeholders with braces in the format `{PLACEHOLDER NAME}` when used in URIs, code examples, and other contexts where placeholders are used. Use uppercase letters with spaces between words for the placeholder name inside the braces.
87
+
-[ ] Wrong: "Launch the app and navigate to `https://localhost:<port>/openapi/v1.json` to view the generated OpenAPI document."
88
+
-[ ] Correct: "Launch the app and navigate to `https://localhost:{PORT}/openapi/v1.json` to view the generated OpenAPI document, where the `{PORT}` placeholder is the port."
85
89
-[ ] For any new or updated .md file, ensure the standard frontmatter (metadata) is included as specified in [Metadata for Microsoft Learn documentation.](https://learn.microsoft.com/en-us/contribute/content/metadata)
86
90
-[ ] For any new or updated .md file added to the repository, ensure the following frontmatter (metadata) is included:
87
91
-[ ] Metadata `ai-usage: ai-assisted` if any AI assistance was used
Copy file name to clipboardExpand all lines: aspnetcore/blazor/call-web-api.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,7 +358,24 @@ The solution includes a demonstration of obtaining weather data securely via an
358
358
359
359
## Disposal of `HttpRequestMessage`, `HttpResponseMessage`, and `HttpClient`
360
360
361
-
An<xref:System.Net.Http.HttpRequestMessage>withoutabodydoesn't require explicit disposal with a [`using` declaration (C# 8 or later)](/dotnet/csharp/language-reference/proposals/csharp-8.0/using) or a [`using` block (all C# releases)](/dotnet/csharp/language-reference/keywords/using), but we recommend disposing with every use for the following reasons:
361
+
An<xref:System.Net.Http.HttpRequestMessage>withoutabodydoesn't require explicit disposal. However, you can dispose of it with either of the following patterns:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/data-binding.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn about data binding features for Razor components and DOM elem
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: wpickett
7
7
ms.custom: mvc, sfi-ropc-nochange
8
-
ms.date: 11/12/2024
8
+
ms.date: 10/30/2025
9
9
uid: blazor/components/data-binding
10
10
---
11
11
# ASP.NET Core Blazor data binding
@@ -230,6 +230,8 @@ The `:get` and `:set` modifiers are always used together.
230
230
231
231
With `:get`/`:set` binding, you can react to a value change before it's applied to the DOM, and you can change the applied value, if necessary. Whereas with `@bind:event="{EVENT}"` attribute binding, where the `{EVENT}` placeholder is a DOM event, you receive the notification after the DOM is updated, and there's no capacity to modify the applied value while binding.
232
232
233
+
The following `BindGetSet` component demonstrates `@bind:get`/`@bind:set` syntax for `<input>` elements and the [`InputText` component](xref:blazor/forms/input-components) used by [Blazor forms](xref:blazor/forms/index) in synchronous (`Set`) and asynchronous (`SetAsync`) scenarios.
234
+
233
235
`BindGetSet.razor`:
234
236
235
237
```razor
@@ -251,7 +253,7 @@ With `:get`/`:set` binding, you can react to a value change before it's applied
@@ -958,6 +960,21 @@ In the following `NestedChild` component, the `NestedGrandchild` component:
958
960
959
961
Prior to the release of .NET 7, two-way binding across components uses `get`/`set` accessors with a third property that discards the <xref:System.Threading.Tasks.Task> returned by <xref:Microsoft.AspNetCore.Components.EventCallback.InvokeAsync%2A?displayProperty=nameWithType> in its setter. To see an example of this approach for .NET 6 or earlier before `@bind:get`/`@bind:set` modifiers became a framework feature, see [the `NestedChild` component of this section in the .NET 6 version of this article](?view=aspnetcore-6.0&preserve-view=true#bind-across-more-than-two-components).
960
962
963
+
The reason to avoid directly changing the value of a component parameter is that it effectively mutates the parent's state from the child component. This can interfere with Blazor's change detection process and trigger extra render cycles because parameters are meant to be *inputs*, they're not meant to be mutable state. In chained scenarios where data is passed among components, directly writing to a component parameter can lead to unintended effects, such as infinite rerenders that hang the app.
964
+
965
+
`@bind:get`/`@bind:set` syntax allows you to:
966
+
967
+
* Avoid creating an extra property that only exists to forward values and callbacks across chained components, which was required prior to the release of .NET 7.
968
+
* Intercept and transform values before they're applied.
969
+
* Keep the parameter immutable in the child, while still supporting two-way binding.
970
+
971
+
A useful analogy is [HTML's `<input>` element](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/input) that tracks the following value states:
972
+
973
+
*`defaultValue`: Like a component parameter received from the parent.
974
+
*`value`: Like the current state inside the component.
975
+
976
+
If you mutate `defaultValue` directly, you're breaking the contract. Instead, these states are kept separate, and only the `value` is updated through controlled means after the initial render of the element. The same reasoning applies to component parameters, and using `@bind:get`/`@bind:set` syntax avoids potential unintended rendering effects associated with writing directly to component parameters.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/js-spa-frameworks.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to create and use Razor components in JavaScript apps and
5
5
monikerRange: '>= aspnetcore-6.0'
6
6
ms.author: wpickett
7
7
ms.custom: mvc
8
-
ms.date: 11/12/2024
8
+
ms.date: 10/26/2025
9
9
uid: blazor/components/js-spa-frameworks
10
10
---
11
11
# Use Razor components in JavaScript apps and SPA frameworks
@@ -241,13 +241,13 @@ For an advanced example with additional features, see the example in the `BasicT
241
241
242
242
:::moniker range=">= aspnetcore-7.0"
243
243
244
-
Use Blazor custom elements to dynamically render Razor components from other SPA frameworks, such as Angular or React.
244
+
Use Blazor custom elements to dynamically render Razor components from different JavaScript technologies, such as [Angular](https://angular.dev/), [React](https://react.dev/), and [Vue](https://vuejs.org/).
245
245
246
246
Blazor custom elements:
247
247
248
248
* Use standard HTML interfaces to implement custom HTML elements.
249
249
* Eliminate the need to manually manage the state and lifecycle of root Razor components using JavaScript APIs.
250
-
* Are useful for gradually introducing Razor components into existing projects written in other SPA frameworks.
250
+
* Are useful for gradually introducing Razor components into existing projects written in other technologies.
251
251
252
252
Custom elements don't support [child content](xref:blazor/components/index#child-content-render-fragments) or [templated components](xref:blazor/components/templated-components).
253
253
@@ -471,7 +471,7 @@ Use the custom element with any web framework. For example, the preceding counte
471
471
472
472
## Generate Angular and React components
473
473
474
-
Generate framework-specific JavaScript (JS) components from Razor components for web frameworks, such as Angular or React. This capability isn't included with .NET, but is enabled by the support for rendering Razor components from JS. The [JS component generation sample on GitHub](https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/JSComponentGeneration) demonstrates how to generate Angular and React components from Razor components. See the GitHub sample app's `README.md` file for additional information.
474
+
Generate JavaScript (JS) components from Razor components for JavaScript technologies, such as Angular or React. This capability isn't included with .NET, but is enabled by the support for rendering Razor components from JS. The [JS component generation sample on GitHub](https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/JSComponentGeneration) demonstrates how to generate Angular and React components from Razor components. See the GitHub sample app's `README.md` file for additional information.
475
475
476
476
> [!WARNING]
477
477
> The Angular and React component features are currently **experimental, unsupported, and subject to change or be removed at any time**. We welcome your feedback on how well this particular approach meets your requirements.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/layouts.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to create reusable layout components for Blazor apps.
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: wpickett
7
7
ms.custom: mvc
8
-
ms.date: 11/12/2024
8
+
ms.date: 10/30/2025
9
9
uid: blazor/components/layouts
10
10
---
11
11
# ASP.NET Core Blazor layouts
@@ -79,8 +79,8 @@ In an app created from a [Blazor project template](xref:blazor/project-structure
79
79
80
80
[Blazor's CSS isolation feature](xref:blazor/components/css-isolation) applies isolated CSS styles to the `MainLayout` component. By convention, the styles are provided by the accompanying stylesheet of the same name, `MainLayout.razor.css`. The ASP.NET Core framework implementation of the stylesheet is available for inspection in the ASP.NET Core reference source (`dotnet/aspnetcore` GitHub repository):
81
81
82
-
*[Blazor Web App`MainLayout.razor.css`](https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor.css)
* Blazor Web App: Locate `MainLayout.razor.css` in the `Components/Layout` folder of the server project in the [project template](https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/quickgrid.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ Set the `QuickGrid` component's <xref:Microsoft.AspNetCore.Components.QuickGrid.
127
127
<QuickGrid Items="..." Pagination="pagination">
128
128
```
129
129
130
-
<!-- UPDATE 10.0 Tracked by https://github.com/dotnet/aspnetcore/issues/57289
130
+
<!-- UPDATE 11.0 Tracked by https://github.com/dotnet/aspnetcore/issues/57289
131
131
for multiple paginator components problem. -->
132
132
133
133
To provide a UI for pagination, add a [`Paginator` component](xref:Microsoft.AspNetCore.Components.QuickGrid.Paginator) above or below the `QuickGrid` component. Set the <xref:Microsoft.AspNetCore.Components.QuickGrid.Paginator.State%2A?displayProperty=nameWithType> to `pagination`:
0 commit comments