Simple Partial Views in MVC

Including a partial view when the page loads is as simple as including @Html.Action in your page. Here I include 2 subviews in the page…

 <div class="tab-pane active" id="notes">
 <div class="panel panel-primary">
   <div class="panel-heading"><span class="panel-title">Notes</span> </div>
     <div class="panel-body">
       <div id="AddNotePartial">
         @Html.Action("TaskNotesPartial2", "Note", new { area = "TaskMgmt", id = Model })
       </div>
     </div>
   </div>
</div>
<div class="tab-pane" id="subtasks">
 <div class="panel panel-primary">
   <div class="panel-heading"><span class="panel-title">Subtasks</span> </div>
     <div class="panel-body">
        @Html.Action("SubTasksPartial", "Task", new { area = "TaskMgmt", id = Model })
     </div>
   </div>
</div>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s