mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
Add item for page 707
This commit is contained in:
parent
6cbb6f2643
commit
d6e8c52aad
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals*, or if you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com.
|
||||
|
||||
[**Errata** (15 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build.
|
||||
[**Errata** (16 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build.
|
||||
|
||||
[**Improvements** (1 item)](improvements.md): Changes to text or code that would improve the content. These are optional.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
**Errata** (15 items)
|
||||
**Errata** (16 items)
|
||||
|
||||
If you find any mistakes, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com.
|
||||
|
||||
|
|
@ -20,6 +20,7 @@ If you find any mistakes, then please [raise an issue in this repository](https:
|
|||
- [Page 631 - Passing parameters using a route value](#page-631---passing-parameters-using-a-route-value)
|
||||
- [Page 641 - Enabling role management and creating a role programmatically](#page-641---enabling-role-management-and-creating-a-role-programmatically)
|
||||
- [Page 649 - Varying cached data by query string](#page-649---varying-cached-data-by-query-string)
|
||||
- [Page 707 - Reviewing the Blazor Server project template](#page-707---reviewing-the-blazor-server-project-template)
|
||||
|
||||
# Page 4, 8 - Pros and cons of the .NET Interactive Notebooks extension, Downloading and installing Visual Studio Code
|
||||
|
||||
|
|
@ -228,3 +229,47 @@ The method name changed in Release Candidate 2, as described [here](https://lear
|
|||
```cs
|
||||
options.AddPolicy("views", p => p.SetVaryByQuery(""));
|
||||
```
|
||||
|
||||
## Page 707 - Reviewing the Blazor Server project template
|
||||
|
||||
> Thanks to [Bob Molloy](https://github.com/BobMolloy) for raising this [issue on 19 December 2022](https://github.com/markjprice/cs11dotnet7/issues/12).
|
||||
|
||||
In Steps 6 and 7, I wrote that there are two files that combine to product the home page for a Blazor Server project, named `_Host.cshtml` and `_Layout.cshtml`.
|
||||
|
||||
Microsoft changed this project template to merge them together so there is no shared layout file named `_Layout.cshtml`. The markup is now all in the `_Host.cshtml` file, as shown in the following markup:
|
||||
```html
|
||||
@page "/"
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@namespace Northwind.BlazorServer.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<base href="~/" />
|
||||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
|
||||
<link href="css/site.css" rel="stylesheet" />
|
||||
<link href="Northwind.BlazorServer.styles.css" rel="stylesheet" />
|
||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
|
||||
</head>
|
||||
<body>
|
||||
<component type="typeof(App)" render-mode="ServerPrerendered" />
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
<environment include="Staging,Production">
|
||||
An error has occurred. This application may no longer respond until reloaded.
|
||||
</environment>
|
||||
<environment include="Development">
|
||||
An unhandled exception has occurred. See browser dev tools for details.
|
||||
</environment>
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue