I am using bootstrap and ASP.NET mvc to create a web app. I am using partial views on each tab however right now all the data is coming in at the same time. I would like to call my partial to query and return data only when the tab is active. How can I do that?
<div>
<ul class="nav nav-tabs nav-justified">
<li class="active"><a href="#tab1" data-toggle="tab">Service</a></li>
<li><a href="#tab2" data-toggle="tab">Instrument</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade in active" id="tab1">
@Html.Action("Index", "Controller1")
</div>
<div class="tab-pane fade" id="tab2">
@Html.Action("Index", "Controller2")
</div>
</div>
</div>