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
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,8 +113,20 @@ When the [`::after` pseudo-selector](https://developer.mozilla.org/docs/Web/CSS/
113
113
114
114
## Not found page title
115
115
116
+
:::moniker range=">= aspnetcore-8.0"
117
+
118
+
*This section only applies to Blazor WebAssembly apps.*
119
+
120
+
In Blazor apps created from Blazor WebAssembly project template, the `NotFound` component template in the `App` component (`App.razor`) sets the page title to `Not found`.
121
+
122
+
:::moniker-end
123
+
124
+
:::moniker range="< aspnetcore-8.0"
125
+
116
126
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/components/layouts.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,6 +245,13 @@ Specifying the layout as a default layout in the `Router` component is a useful
245
245
246
246
To set a layout for arbitrary Razor template content, specify the layout with a <xref:Microsoft.AspNetCore.Components.LayoutView> component. You can use a <xref:Microsoft.AspNetCore.Components.LayoutView> in any Razor component. The following example sets a layout component named `ErrorLayout` for the `MainLayout` component's <xref:Microsoft.AspNetCore.Components.Routing.Router.NotFound> template (`<NotFound>...</NotFound>`).
247
247
248
+
:::moniker range=">= aspnetcore-8.0"
249
+
250
+
> [!NOTE]
251
+
> The following example is specifically for a Blazor WebAssembly app because Blazor Web Apps don't use the <xref:Microsoft.AspNetCore.Components.Routing.Router.NotFound> template (`<NotFound>...</NotFound>`). However, the template is supported for backward compatibility to avoid a breaking change in the framework. Blazor Web Apps typically process bad URL requests by either displaying the browser's built-in 404 UI or returning a custom 404 page from the ASP.NET Core server via ASP.NET Core middleware (for example, [`UseStatusCodePagesWithRedirects`](xref:fundamentals/error-handling#usestatuscodepageswithredirects) / [API documentation](xref:Microsoft.AspNetCore.Builder.StatusCodePagesExtensions.UseStatusCodePagesWithRedirects%2A)).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/fundamentals/routing.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,8 +112,11 @@ When the <xref:Microsoft.AspNetCore.Components.Routing.Router> component navigat
112
112
113
113
## Provide custom content when content isn't found
114
114
115
-
<!-- UPDATE 8.0 NotFound isn't part of the BWA template ...
116
-
confirm if it's a no-op with SSR/BWA -->
115
+
:::moniker range=">= aspnetcore-8.0"
116
+
117
+
*This section only applies to Blazor WebAssembly apps.* Blazor Web Apps don't use the <xref:Microsoft.AspNetCore.Components.Routing.Router.NotFound> template (`<NotFound>...</NotFound>`), but the template is supported for backward compatibility to avoid a breaking change in the framework. Blazor Web Apps typically process bad URL requests by either displaying the browser's built-in 404 UI or returning a custom 404 page from the ASP.NET Core server via ASP.NET Core middleware (for example, [`UseStatusCodePagesWithRedirects`](xref:fundamentals/error-handling#usestatuscodepageswithredirects) / [API documentation](xref:Microsoft.AspNetCore.Builder.StatusCodePagesExtensions.UseStatusCodePagesWithRedirects%2A)).
118
+
119
+
:::moniker-end
117
120
118
121
The <xref:Microsoft.AspNetCore.Components.Routing.Router> component allows the app to specify custom content if content isn't found for the requested route.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/index.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -279,9 +279,6 @@ If `user.Identity.IsAuthenticated` is `true`, claims can be enumerated and membe
279
279
280
280
Set up the `Task<`<xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationState>`>`[cascading parameter](xref:blazor/components/cascading-values-and-parameters) using the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView> and <xref:Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState> components.
281
281
282
-
<!-- UPDATE 8.0 Need to confirm this next bit in the BWA world
283
-
e.g., did Found survive the NotFound removal? -->
284
-
285
282
When you create a Blazor app from one of the Blazor project templates with authentication enabled, the app includes the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView> and <xref:Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState> components shown in the following example. A client-side Blazor app includes the required service registrations as well. Additional information is presented in the [Customize unauthorized content with the Router component](#customize-unauthorized-content-with-the-router-component) section.
286
283
287
284
```razor
@@ -292,7 +289,6 @@ When you create a Blazor app from one of the Blazor project templates with authe
292
289
DefaultLayout="@typeof(MainLayout)" />
293
290
...
294
291
</Found>
295
-
...
296
292
</Router>
297
293
</CascadingAuthenticationState>
298
294
```
@@ -502,9 +498,6 @@ Not authorized.
502
498
503
499
To authorize users for resources, pass the request's route data to the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView.Resource> parameter of <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView>.
504
500
505
-
<!-- UPDATE 8.0 Confirm the following remark in the BWA world
506
-
i.e., did Found content survive the NotFound drop? -->
507
-
508
501
In the <xref:Microsoft.AspNetCore.Components.Routing.Router.Found?displayProperty=nameWithType> content for a requested route:
509
502
510
503
```razor
@@ -605,9 +598,6 @@ In the following `EditUser` component, the resource at `/users/{id}/edit` has a
605
598
606
599
The <xref:Microsoft.AspNetCore.Components.Routing.Router> component, in conjunction with the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView> component, allows the app to specify custom content if:
607
600
608
-
<!-- UPDATE 8.0 React to NotFound changes in the BWA world
609
-
the following removed NotFound content and tags -->
610
-
611
601
* The user fails an [`[Authorize]`](xref:Microsoft.AspNetCore.Authorization.AuthorizeAttribute) condition applied to the component. The markup of the [`<NotAuthorized>`](xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView.NotAuthorized?displayProperty=nameWithType) element is displayed. The [`[Authorize]`](xref:Microsoft.AspNetCore.Authorization.AuthorizeAttribute) attribute is covered in the [`[Authorize]` attribute](#authorize-attribute) section.
612
602
* Asynchronous authorization is in progress, which usually means that the process of authenticating the user is in progress. The markup of the [`<Authorizing>`](xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView.Authorizing?displayProperty=nameWithType) element is displayed.
613
603
@@ -624,13 +614,22 @@ The <xref:Microsoft.AspNetCore.Components.Routing.Router> component, in conjunct
624
614
</Authorizing>
625
615
</AuthorizeRouteView>
626
616
</Found>
627
-
...
628
617
</Router>
629
618
</CascadingAuthenticationState>
630
619
```
631
620
621
+
:::moniker range=">= aspnetcore-8.0"
622
+
623
+
The content of `<NotAuthorized>` and `<Authorizing>` tags can include arbitrary items, such as other interactive components.
624
+
625
+
:::moniker-end
626
+
627
+
:::moniker range="< aspnetcore-8.0"
628
+
632
629
The content of `<NotFound>`, `<NotAuthorized>`, and `<Authorizing>` tags can include arbitrary items, such as other interactive components.
633
630
631
+
:::moniker-end
632
+
634
633
If the `<NotAuthorized>` tag isn't specified, the <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView> uses the following fallback message:
Confirm or add an <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView> and <xref:Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState> for the Blazor router:
199
199
200
-
<!-- UPDATE 8.0 Check for dropping NotFound
201
-
Did Found survive? -->
202
-
203
200
```razor
204
201
<CascadingAuthenticationState>
205
202
<Router ...>
@@ -208,7 +205,6 @@ Confirm or add an <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeR
0 commit comments