Wednesday, 18 September 2013

What is the point of Partial Views in Asp.net MVC

What is the point of Partial Views in Asp.net MVC

Ive noticed that there seems to be no real difference between a view and a
partial view. For instance, one can create a view but can render it as a
partial view by using
@Html.Partial("ViewName")
or by specifying that its action return it as
return PartialView();
Ive noticed that the opposite is also the case - ie, one can create a
partial view but if it is returned as a full view, it will be displayed
with the default layout for the views.
My question is this - When adding a new view in Visual Studio, one is
given the option of creating a view that is partial or not. Isn't this
redundant, since a view can be rendered as both a partial and a full view
anyway?

No comments:

Post a Comment