Based on the true condition, I am making some operations. But I want to simplify the below HTML code in a better way.
@{
bool savingHtml = (Request.QueryString["savehtml"] == "1");
string activeTab = Request.QueryString["from"];
}
@if (savingHtml)
{
if (activeTab.ToLower() == "index")
{
<div class="summaryTab">
<ul class="nav nav-tabs" data-tabs="tabs">
<li><a data-toggle="tab" href="#heat">Heat Map</a></li>
<li class="active"><a data-toggle="tab" href="#table">Table</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane active" id="table1">
@Html.Partial("~/Views/Shared.MultiQuery/_resultset.cshtml", Model)
</div>
<div class="tab-pane" id="heat1">
</div>
</div>
}
else{
<div class="summaryTab">
<ul class="nav nav-tabs" data-tabs="tabs">
<li class="active"><a data-toggle="tab" href="#heat">Heat Map</a></li>
<li><a data-toggle="tab" href="#table">Table</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane" id="table2">
</div>
<div class="tab-pane active" id="heat2">
@Html.Partial("~/Views/Shared.MultiQuery/_resultset.cshtml", Model)
</div>
</div>
}
}
else
{
<div class="summaryTab">
<ul class="nav nav-tabs" data-tabs="tabs">
<li><a data-toggle="tab" href="#heat">Heat Map</a></li>
<li class="active"><a data-toggle="tab" href="#table">Table</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane active" id="table">
@Html.Partial("~/Views/Shared.MultiQuery/_resultset.cshtml", Model)
</div>
<div class="tab-pane" id="heat">
</div>
</div>
}