diff --git a/aspnetcore/blazor/components/cascading-values-and-parameters.md b/aspnetcore/blazor/components/cascading-values-and-parameters.md index 26ad49f72027..b3f08170efa2 100644 --- a/aspnetcore/blazor/components/cascading-values-and-parameters.md +++ b/aspnetcore/blazor/components/cascading-values-and-parameters.md @@ -104,7 +104,13 @@ The following `ThemeInfo` C# class is placed in a folder named `UIThemeClasses` `UIThemeClasses/ThemeInfo.cs`: -:::moniker range=">= aspnetcore-7.0" +:::moniker range=">= aspnetcore-8.0" + +:::code language="csharp" source="~/../blazor-samples/8.0/BlazorSample_WebAssembly/UIThemeClasses/ThemeInfo.cs"::: + +:::moniker-end + +:::moniker range=">= aspnetcore-7.0 < aspnetcore-8.0" :::code language="csharp" source="~/../blazor-samples/7.0/BlazorSample_WebAssembly/UIThemeClasses/ThemeInfo.cs"::: diff --git a/aspnetcore/blazor/components/element-component-model-relationships.md b/aspnetcore/blazor/components/element-component-model-relationships.md index 7a0eeb14391b..f5d9525466ce 100644 --- a/aspnetcore/blazor/components/element-component-model-relationships.md +++ b/aspnetcore/blazor/components/element-component-model-relationships.md @@ -52,9 +52,17 @@ This demonstration allows you to: In the following `PeopleExample` component, each iteration of adding a person in `OnTimerCallback` results in Blazor rebuilding the entire collection. The page's focus remains on the *same index* position of `` elements, so the focus shifts each time a person is added. *Shifting the focus away from what the user selected isn't desirable behavior.* After demonstrating the poor behavior with the following component, the [`@key`](xref:mvc/views/razor#key) directive attribute is used to improve the user's experience. -`PeopleExample.razor`: +:::moniker range=">= aspnetcore-8.0" -:::moniker range=">= aspnetcore-7.0" +`People.razor`: + +:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Pages/People.razor"::: + +:::moniker-end + +:::moniker range=">= aspnetcore-7.0 < aspnetcore-8.0" + +`PeopleExample.razor`: :::code language="razor" source="~/../blazor-samples/7.0/BlazorSample_WebAssembly/Pages/element-component-model-relationships/PeopleExample.razor"::: @@ -62,18 +70,24 @@ In the following `PeopleExample` component, each iteration of adding a person in :::moniker range=">= aspnetcore-6.0 < aspnetcore-7.0" +`PeopleExample.razor`: + :::code language="razor" source="~/../blazor-samples/6.0/BlazorSample_WebAssembly/Pages/element-component-model-relationships/PeopleExample.razor"::: :::moniker-end :::moniker range=">= aspnetcore-5.0 < aspnetcore-6.0" +`PeopleExample.razor`: + :::code language="razor" source="~/../blazor-samples/5.0/BlazorSample_WebAssembly/Pages/element-component-model-relationships/PeopleExample.razor"::: :::moniker-end :::moniker range="< aspnetcore-5.0" +`PeopleExample.razor`: + :::code language="razor" source="~/../blazor-samples/3.1/BlazorSample_WebAssembly/Pages/element-component-model-relationships/PeopleExample.razor"::: :::moniker-end diff --git a/aspnetcore/blazor/components/index.md b/aspnetcore/blazor/components/index.md index c6b71fc9bd7c..a66aa0121da4 100644 --- a/aspnetcore/blazor/components/index.md +++ b/aspnetcore/blazor/components/index.md @@ -1265,9 +1265,17 @@ Strings are normally rendered using DOM text nodes, which means that any markup The following example shows using the type to add a block of static HTML content to the rendered output of a component. -`MarkupStringExample.razor`: +:::moniker range=">= aspnetcore-8.0" -:::moniker range=">= aspnetcore-7.0" +`MarkupStrings.razor`: + +:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Pages/MarkupStrings.razor"::: + +:::moniker-end + +:::moniker range=">= aspnetcore-7.0 < aspnetcore-8.0" + +`MarkupStringExample.razor`: :::code language="razor" source="~/../blazor-samples/7.0/BlazorSample_WebAssembly/Pages/index/MarkupStringExample.razor"::: @@ -1275,18 +1283,24 @@ The following example shows using the ...`) in the header (`
...
`), navigation bar (``), and trademark information element (`
...
`) in the footer (`
...
`) come from the `DoctorWhoLayout` component. -* The **Episodes** heading (`

...

`) and episode list (``) come from the `Episodes` component. +* The H1 "database" heading (`

...

`) in the header (`
...
`), navigation bar (``), and trademark information in the footer (`
...
`) come from the `DoctorWhoLayout` component. +* The H2 "episodes" heading (`

...

`) and episode list (``) come from the `Episodes` component. ```html - -
-
-

Doctor Who™ Episode Database

-
- - - -

Episodes

- -
    -
  • ...
  • -
  • ...
  • -
  • ...
  • -
- -
- Doctor Who is a registered trademark of the BBC. - https://www.doctorwho.tv/ -
-
- +
+

...

+
+ + + +

...

+ + + +
+ ... +
``` Specifying the layout directly in a component overrides a *default layout*: @@ -312,48 +305,43 @@ The `ProductionsLayout` component contains the top-level layout elements, where The following rendered HTML markup is produced by the preceding nested layout. Extraneous markup doesn't appear in order to focus on the nested content provided by the three components involved: * The header (`
...
`), production navigation bar (``), and footer (`
...
`) elements and their content come from the `ProductionsLayout` component. -* The **Doctor Who™ Episode Database** heading (`

...

`), episode navigation bar (``), and trademark information element (`
...
`) come from the `DoctorWhoLayout` component. -* The **Episodes** heading (`

...

`) and episode list (``) come from the `Episodes` component. +* The H1 "database" heading (`

...

`), episode navigation bar (``), and trademark information (`
...
`) come from the `DoctorWhoLayout` component. +* The H2 "episodes" heading (`

...

`) and episode list (``) come from the `Episodes` component. ```html - -
-
-

Productions

-
- - - -

Doctor Who™ Episode Database

- - - -

Episodes

- -
    -
  • ...
  • -
  • ...
  • -
  • ...
  • -
- -
- Doctor Who is a registered trademark of the BBC. - https://www.doctorwho.tv/ -
- -
- Footer of Productions Layout -
-
- +
+ ... +
+ + + +

...

+ + + +

...

+ + + +
+ ... +
+ +
+ ... +
``` ## Share a Razor Pages layout with integrated components diff --git a/aspnetcore/blazor/file-uploads.md b/aspnetcore/blazor/file-uploads.md index 1b37956dc02d..02e56786ec12 100644 --- a/aspnetcore/blazor/file-uploads.md +++ b/aspnetcore/blazor/file-uploads.md @@ -273,7 +273,7 @@ else The following example processes file bytes and doesn't send files to a destination outside of the app. For an example of a Razor component that sends a file to a server or service, see the following sections: -* [Upload files to a server with client-side rendering](#upload-files-to-a-server-with-client-side-rendering) +* [Upload files to a server](#upload-files-to-a-server) * [Upload files to an external service](#upload-files-to-an-external-service) :::moniker range=">= aspnetcore-8.0" @@ -757,19 +757,7 @@ In the preceding code, is called to g The server app must register controller services and map controller endpoints. For more information, see . -## Upload files to a server with client-side rendering - -:::moniker range=">= aspnetcore-8.0" - -*This section applies to client-side rendered Razor components in either a Blazor Web App or a standalone Blazor WebAssembly app.* - -:::moniker-end - -:::moniker range="< aspnetcore-8.0" - -*This section applies to hosted Blazor WebAssembly apps.* - -:::moniker-end +## Upload files to a server The following example demonstrates uploading files to a web API controller. diff --git a/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/Pages/Index.cshtml b/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/Pages/Index.cshtml index 0ed63c063d75..6fdc6be92d17 100644 --- a/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/Pages/Index.cshtml +++ b/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/Pages/Index.cshtml @@ -87,7 +87,7 @@ Starship = starship; <tvshow> <metadata> <series>Dr. Who</series> - <title>The Sun Makers</title> + <title>The Sunmakers</title> <airdate>11/26/1977</airdate> <episodes>4</episodes> </metadata> diff --git a/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/tvshow.xml b/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/tvshow.xml index fecd46982e93..6e5bd45d8ad4 100644 --- a/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/tvshow.xml +++ b/aspnetcore/fundamentals/configuration/index/samples/2.x/ConfigurationSample/tvshow.xml @@ -3,7 +3,7 @@ Dr. Who - The Sun Makers + The Sunmakers 11/26/1977 4 diff --git a/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/Pages/Index.cshtml b/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/Pages/Index.cshtml index ecf4738d8eaf..b740803697f5 100644 --- a/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/Pages/Index.cshtml +++ b/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/Pages/Index.cshtml @@ -87,7 +87,7 @@ Starship = starship; <tvshow> <metadata> <series>Dr. Who</series> - <title>The Sun Makers</title> + <title>The Sunmakers</title> <airdate>11/26/1977</airdate> <episodes>4</episodes> </metadata> diff --git a/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/tvshow.xml b/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/tvshow.xml index fecd46982e93..6e5bd45d8ad4 100644 --- a/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/tvshow.xml +++ b/aspnetcore/fundamentals/configuration/index/samples/3.x/ConfigurationSample/tvshow.xml @@ -3,7 +3,7 @@ Dr. Who - The Sun Makers + The Sunmakers 11/26/1977 4