Remove [ViewData] example using @Model with a controller (#17805)
parent
a92a74bed0
commit
5ec5c96d04
|
@ -266,12 +266,6 @@ public class HomeController : Controller
|
|||
}
|
||||
```
|
||||
|
||||
In the About view, access the `Title` property as a model property:
|
||||
|
||||
```cshtml
|
||||
<h1>@Model.Title</h1>
|
||||
```
|
||||
|
||||
In the layout, the title is read from the ViewData dictionary:
|
||||
|
||||
```cshtml
|
||||
|
|
Loading…
Reference in New Issue