Skip to content

Commit e0964ca

Browse files
authored
Merge pull request #34037 from dotnet/main
2 parents b797730 + 4553d60 commit e0964ca

File tree

18 files changed

+110
-73
lines changed

18 files changed

+110
-73
lines changed

aspnetcore/blazor/components/dynamiccomponent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,13 @@ For a working demonstration of the preceding example, see the [`DynamicComponent
549549

550550
:::moniker range=">= aspnetcore-7.0 < aspnetcore-8.0"
551551

552-
For a working demonstration of the preceding example, see the [`DynamicComponentExample4` component in the Blazor sample app](https://github.com/dotnet/blazor-samples/blob/main/7.0/BlazorSample_BlazorServer/Pages/dynamiccomponent/DynamicComponentExample4.razor).
552+
For a working demonstration of the preceding example, see the [`DynamicComponentExample4` component in the Blazor sample app](https://github.com/dotnet/blazor-samples/blob/main/7.0/BlazorSample_Server/Pages/dynamiccomponent/DynamicComponentExample4.razor).
553553

554554
:::moniker-end
555555

556556
:::moniker range="< aspnetcore-7.0"
557557

558-
For a working demonstration of the preceding example, see the [`DynamicComponentExample4` component in the Blazor sample app](https://github.com/dotnet/blazor-samples/blob/main/6.0/BlazorSample_BlazorServer/Pages/dynamiccomponent/DynamicComponentExample4.razor).
558+
For a working demonstration of the preceding example, see the [`DynamicComponentExample4` component in the Blazor sample app](https://github.com/dotnet/blazor-samples/blob/main/6.0/BlazorSample_Server/Pages/dynamiccomponent/DynamicComponentExample4.razor).
559559

560560
:::moniker-end
561561

aspnetcore/blazor/components/js-spa-frameworks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ window.showQuote = async () => {
126126
});
127127
}
128128

129-
const btn = document.querySelector("showQuoteBtn");
129+
const btn = document.querySelector("#showQuoteBtn");
130130
btn.addEventListener("click", showQuote);
131131
```
132132

aspnetcore/blazor/components/layouts.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ In an app created from a [Blazor project template](xref:blazor/project-structure
8181

8282
[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):
8383

84-
* [Blazor Web App `MainLayout.razor.css`](https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor.css)
84+
* [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)
8585
* [Blazor WebAssembly `MainLayout.razor.css`](https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Layout/MainLayout.razor.css)
8686

8787
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
@@ -90,12 +90,7 @@ In an app created from a [Blazor project template](xref:blazor/project-structure
9090

9191
:::moniker range=">= aspnetcore-5.0 < aspnetcore-8.0"
9292

93-
[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):
94-
95-
* [Blazor Server `MainLayout.razor.css`](https://github.com/dotnet/aspnetcore/blob/release/7.0/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/MainLayout.razor.css)
96-
* [Blazor WebAssembly `MainLayout.razor.css`](https://github.com/dotnet/aspnetcore/blob/release/7.0/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Shared/MainLayout.razor.css)
97-
98-
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
93+
[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`.
9994

10095
:::moniker-end
10196

aspnetcore/blazor/components/render-modes.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,7 @@ In the following example, the render mode is set interactive SSR by adding `@ren
391391
}
392392
```
393393

394-
If using the preceding component in a Blazor Web App, place the component in the server project's `Components/Pages` folder&dagger;. The server project is the solution's project with a name that doesn't end in `.Client`. When the app is running, navigate to `/render-mode-2` in the browser's address bar.
395-
396-
> [!IMPORTANT]
397-
> &dagger;If the app adopts global WebAssembly or global Auto rendering via the `Routes` component, individual components that specify interactive SSR (`@rendermode InteractiveServer`) in their component definition file (`.razor`) are *placed in the `.Client` project's `Pages` folder*.
398-
>
399-
> Placing interactive SSR components in the `.Client` project is counter-intuitive because such components are only rendered on the server.
400-
>
401-
> If you place an interactive SSR component in the server project's `Components/Pages` folder of a global WebAssembly or Auto app, the component is prerendered normally and briefly displayed in the user's browser. However, the client-side router isn't able to find the component, ultimately resulting in a *404 - Not Found* in the browser.
402-
>
403-
> Therefore, place interactive SSR components in the `.Client` project's `Pages` folder if the app adopts global WebAssembly or global Auto rendering via the `Routes` component.
394+
If using the preceding component in a Blazor Web App, place the component in the server project's `Components/Pages` folder. The server project is the solution's project with a name that doesn't end in `.Client`. When the app is running, navigate to `/render-mode-2` in the browser's address bar.
404395

405396
## Client-side rendering (CSR)
406397

aspnetcore/blazor/file-downloads.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@ This article explains how to download files in Blazor apps.
1616

1717
## File downloads
1818

19-
Files can be downloaded from the app's own static assets or from any other location:
20-
21-
:::moniker range=">= aspnetcore-9.0"
22-
23-
* ASP.NET Core apps use Map Static Assets routing endpoint conventions or Static File Middleware to serve files to clients of server-side apps. For more information, see <xref:blazor/fundamentals/static-files>.
24-
* The guidance in this article also applies to other types of file servers that don't use .NET, such as Content Delivery Networks (CDNs).
25-
26-
:::moniker-end
27-
28-
:::moniker range="< aspnetcore-9.0"
29-
30-
* ASP.NET Core apps use [Static File Middleware](xref:blazor/fundamentals/static-files) to serve files to clients of server-side apps.
31-
* The guidance in this article also applies to other types of file servers that don't use .NET, such as Content Delivery Networks (CDNs).
32-
33-
:::moniker-end
34-
3519
This article covers approaches for the following scenarios, where a file shouldn't be opened by a browser but downloaded and saved on the client:
3620

3721
* [Stream file content to a raw binary data buffer on the client](#download-from-a-stream): Typically, this approach is used for relatively small files (\< 250 MB).
@@ -265,6 +249,7 @@ For more information on CORS with ASP.NET Core apps and other Microsoft products
265249
266250
## Additional resources
267251
252+
* <xref:blazor/fundamentals/static-files>
268253
* <xref:blazor/js-interop/index>
269254
* <xref:blazor/js-interop/javascript-location>
270255
* <xref:blazor/js-interop/ssr>

aspnetcore/blazor/host-and-deploy/configure-linker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Control linking on a per-assembly basis by providing an XML configuration file a
7575
</linker>
7676
```
7777

78-
For more information and examples, see [Data Formats (dotnet/linker GitHub repository)](https://github.com/dotnet/linker/blob/main/docs/data-formats.md).
78+
For more information and examples, see [Data Formats (`dotnet/runtime` GitHub repository)](https://github.com/dotnet/runtime/blob/main/docs/tools/illink/data-formats.md).
7979

8080
## Add an XML linker configuration file to a library
8181

aspnetcore/blazor/progressive-web-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ In the app's `wwwroot/index.html` file:
120120

121121
:::moniker range="< aspnetcore-8.0"
122122

123-
* Navigate to the ASP.NET Core GitHub repository at the following URL, which links to the `release/7.0` branch reference source and assets. If you're using a version of ASP.NET Core later than 7.0, change the document version selector to see the updated guidance for this section. Select the release that you're working with from the **Switch branches or tags** dropdown list that applies to your app.
123+
* Navigate to the ASP.NET Core GitHub repository at the following URL, which links to the `release/6.0` branch reference source and assets. If you're using a version of ASP.NET Core later than 6.0, change the document version selector to see the updated guidance for this section. Select the release that you're working with from the **Switch branches or tags** dropdown list that applies to your app.
124124

125-
[Blazor WebAssembly project template `wwwroot` folder (`dotnet/aspnetcore` GitHub repository `release/7.0` branch)](https://github.com/dotnet/aspnetcore/tree/release/7.0/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot)
125+
[Blazor WebAssembly project template `wwwroot` folder](https://github.com/dotnet/aspnetcore/tree/release/6.0/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot)
126126

127127
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
128128

aspnetcore/blazor/security/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,19 +439,19 @@ You can also supply different content for display if the user isn't authorized w
439439
<AuthorizeView>
440440
<Authorized>
441441
<p>Hello, @context.User.Identity?.Name!</p>
442-
<p><button @onclick="SecureMethod">Authorized Only Button</button></p>
442+
<p><button @onclick="HandleClick">Authorized Only Button</button></p>
443443
</Authorized>
444444
<NotAuthorized>
445445
<p>You're not authorized.</p>
446446
</NotAuthorized>
447447
</AuthorizeView>
448448
449449
@code {
450-
private void SecureMethod() { ... }
450+
private void HandleClick() { ... }
451451
}
452452
```
453453

454-
A default event handler for an authorized element, such as the `SecureMethod` method for the `<button>` element in the preceding example, can only be invoked by an authorized user.
454+
Although the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView> component controls the visibility of elements based on the user’s authorization status, it doesn't enforce security on the event handler itself. In the preceding example, the `HandleClick` method is only associated with a button visible to authorized users, but nothing prevents invoking this method from other places. To ensure method-level security, implement additional authorization logic within the handler itself or in the relevant API.
455455

456456
:::moniker range=">= aspnetcore-8.0"
457457

@@ -502,7 +502,7 @@ The preceding code establishes a `Context` for the inner <xref:Microsoft.AspNetC
502502

503503
For more information, including configuration guidance, see <xref:security/authorization/roles>.
504504

505-
For policy-based authorization, use the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView.Policy> parameter with a single policy:
505+
For policy-based authorization, use the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView.Policy> parameter with a single policy name:
506506

507507
```razor
508508
<AuthorizeView Policy="Over21">

aspnetcore/blazor/security/webassembly/graph-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ When testing with the Graph SDK locally, we recommend using a new InPrivate/inco
432432

433433
:::zone pivot="graph-sdk-4"
434434

435-
*The following guidance applies to Microsoft Graph v4. If you're upgrading an app from SDK v4 to v5, see the [Microsoft Graph .NET SDK v5 changelog and upgrade guide](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/upgrade-to-v5.md).*
435+
*The following guidance applies to Microsoft Graph v4. If you're upgrading an app from SDK v4 to v5, see the [Microsoft Graph .NET SDK v5 changelog and upgrade guide](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/main/docs/upgrade-to-v5.md).*
436436

437437
The Microsoft Graph SDK for use in Blazor apps is called the *Microsoft Graph .NET Client Library*.
438438

aspnetcore/blazor/security/webassembly/standalone-with-identity.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ The app uses the following NuGet packages:
183183
The `Models` folder contains the app's models:
184184

185185
* [`FormResult` (`Identity/Models/FormResult.cs`)](https://github.com/dotnet/blazor-samples/blob/main/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/Models/FormResult.cs): Response for login and registration.
186-
* [`UserBasic` (`Identity/Models/UserBasic.cs`)](https://github.com/dotnet/blazor-samples/blob/main/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/Models/UserBasic.cs): Basic user information to register and login.
187186
* [`UserInfo` (`Identity/Models/UserInfo.cs`)](https://github.com/dotnet/blazor-samples/blob/main/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/Models/UserInfo.cs): User info from identity endpoint to establish claims.
188187

189188
The [`IAccountManagement` interface (`Identity/CookieHandler.cs`)](https://github.com/dotnet/blazor-samples/blob/main/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/IAccountManagement.cs) provides account management services.

0 commit comments

Comments
 (0)