Thursday, 11 September 2014

How did you create a partial view and consume it ?



When you add a view to your project you need to check the “Create partial view” check box.


Figure: Create partial view

Once the partial view is created you can then call the partial view in the main view using the Html.RenderPartialmethod as shown in the below code snippet:

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

No comments:

Post a Comment