Wednesday 7 October 2015

partial views

Partial view is a reusable view (like a user control) which can be embedded inside other view.

For every page you would like to reuse the left menu, header and footer controls. So you can go
and create partial views for each of these items and then you call that partial view in the main
view.

Once the partial view is created you can then call the partial view in the main view using
“Html.RenderPartial” method as shown in the below code snippet.

<body>
<div>
<% Html.RenderPartial("MyView"); %>
</div>
</body>

No comments:

Post a Comment