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: aspnetcore/blazor/components/control-head-content.md
+27-7
Original file line number
Diff line number
Diff line change
@@ -64,33 +64,53 @@ In a **required**, shared `_Layout.cshtml` file of a prerendered hosted Blazor W
64
64
65
65
The <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component renders content provided by <xref:Microsoft.AspNetCore.Components.Web.PageTitle> and <xref:Microsoft.AspNetCore.Components.Web.HeadContent> components.
66
66
67
-
In an app created from the Blazor WebAssembly project template, the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component is added to the <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.RootComponents> collection of the <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder> in `Program.cs`:
In a Blazor Web App created from the project template, the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component in `App.razor` renders `<head>` content:
70
+
71
+
```razor
72
+
<head>
73
+
...
74
+
<HeadOutlet />
75
+
</head>
71
76
```
72
77
73
-
When the [`::after` pseudo-selector](https://developer.mozilla.org/docs/Web/CSS/::after) is specified, the contents of the root component are appended to the existing head contents instead of replacing the content. This allows the app to retain static head content in `wwwroot/index.html` without having to repeat the content in the app's Razor components.
In Blazor Server apps created from the Blazor Server project template, a [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) renders `<head>` content for the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component in `Pages/_Host.cshtml`:
In Blazor Server apps created from the Blazor Server project template, a [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) renders `<head>` content for the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component in `Pages/_Layout.cshtml`:
In an app created from the Blazor WebAssembly project template, the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component is added to the <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.RootComponents> collection of the <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder> in `Program.cs`:
When the [`::after` pseudo-selector](https://developer.mozilla.org/docs/Web/CSS/::after) is specified, the contents of the root component are appended to the existing head contents instead of replacing the content. This allows the app to retain static head content in `wwwroot/index.html` without having to repeat the content in the app's Razor components.
113
+
94
114
## Not found page title
95
115
96
116
In Blazor apps created from Blazor project templates, the `NotFound` component template in the `App` component (`App.razor`) sets the page title to `Not found`.
Copy file name to clipboardexpand all lines: aspnetcore/blazor/state-management.md
+1-5
Original file line number
Diff line number
Diff line change
@@ -270,11 +270,7 @@ To disable prerendering, open the `Pages/_Host.cshtml` file and change the `rend
270
270
271
271
:::moniker range=">= aspnetcore-6.0"
272
272
273
-
[Prerendering of `<head>` content](xref:blazor/components/control-head-content) is disabled in [`<head>` content](xref:blazor/project-structure#location-of-head-content):
0 commit comments