I am Newer in ASP.NET MVC. I can not Clearly Understand the difference among
Strongly Typed view vs Normal View vs Partial View vs Dynamic-type View
in Asp.NET MVC. Anyone describe me about this terms.
Thanks in advance!!!
I am Newer in ASP.NET MVC. I can not Clearly Understand the difference among
Strongly Typed view vs Normal View vs Partial View vs Dynamic-type View
in Asp.NET MVC. Anyone describe me about this terms.
Thanks in advance!!!
A view which is bound to a view model. For example if you have the following view model:
that is passed to the view by the controller action:
the strongly typed view will have the
@model
directive at the top pointing to this view model:The difference between a view and a partial view is that a partial view only contains some small HTML fragments that can be reused in multiple parts of a normal view. For example you could define the following partial view:
and then render this partial view at multiple places in your main view to avoid repetition of the same code over and over:
A view which doesn't have a model or one that uses weakly typed structures such as
ViewBag
. For example you could have a controller action which sets some property in theViewBag
:and the corresponding view you could access this property by using the same key in the ViewBag: