What are the differences between strongly-type view and normal view in asp.net MVC?
When I add a View
by right click on my Controller
into my asp.net MVC project, I have checked a checkbox named Create a strong-typed view. What are the things will change when I checked that checkbox?
Thanks.
With strongly typed views, your view file will have the following directive
at the top of the file
This signifies to the view that
@Html
helpers and@Model
helpers will interact with a class of that type.For example
Assuming
MyProperty
is a property onYourModel
class.You can create your views manually, and just add the
@model
directive at the top of the page yourself.