Update improvements.md

This commit is contained in:
Mark J Price 2023-03-04 08:27:47 +00:00
parent b79899f573
commit 9a5989ca75

View file

@ -304,11 +304,11 @@ In the next edition, I will add a warning, as shown in the following note:
# Page 601 - Setting up an ASP.NET Core MVC website
This sections starts with a description of the three parts of MVC. For views, I wrote, "Views: Razor files, that is, `.cshtml` files, that render data in view models into HTML web pages. Blazor uses the `.razor` file extension, but do not confuse them with Razor files!"
This section starts with a description of the three parts of MVC. For views, I wrote, "**Views**: Razor files, that is, `.cshtml` files, that render data in view models into HTML web pages. Blazor uses the `.razor` file extension, but do not confuse them with Razor files!"
In the next edition, I will changed this text and add a warning:
In the next edition, I will improve this text and add a warning:
"Views: *Razor View* files, that is, `.cshtml` files, that render data in view models into HTML web pages. *Razor Views* are different from *Razor Pages* but they share the same file extension `.cshtml`. When creating a *Razor Page*, you must add the `@page` directive at the top of the file. When creating a *Razor View*, do NOT use the `@page` directive! If you do, the controller will not pass the model to it and the model in the view will be `null`, throwing a `NullRefertenceException` when you try to access any of its members. Blazor uses the `.razor` file extension, but do not confuse them with *Razor View* or *Razor Page* files! Blazor can also use the `@page` directive to allow a Blazor component to act like a page!"
"**Views**: *Razor View* files, that is, `.cshtml` files, that render data in view models into HTML web pages. *Razor Views* are different from *Razor Pages* but they share the same file extension `.cshtml`. When creating a *Razor Page*, it must have the `@page` directive at the top of its file. When creating a *Razor View*, do NOT use the `@page` directive! If you do, the controller will not pass the model and it will be `null`, throwing a `NullReferenceException` when you try to access any of its members. Also note that Blazor uses the `.razor` file extension, but do not confuse them with *Razor View* or *Razor Page* files! To add even more confusion, Blazor can also use the `@page` directive to allow a Blazor component to act like a page!"
# Page 654 - Making controller action methods asynchronous