我的Razor中有以下标签:
<div class="page-tabs">
<ul class="nav nav-tabs">
@if (!Model.OriginalWork.IsNew)
{
<li class='@(ViewBag.IsAmendment == "0" ? "active" : "")'>
<a href='@Url.Action("ReviewDetails", "SongsManagement", new { isAmendment = 0 }))' title="Original">Original</a>
</li>
<li class='@(ViewBag.IsAmendment == "1" ? "active" : "")'>
<a href='@Url.Action("ReviewDetails", "SongsManagement", new { isAmendment = 1 })' title="Amendment">Active Amendment</a>
</li>
}
</ul>
当我单击第二个选项卡时,它显示为活动状态。当我单击原件时,它没有变化吗?
答案 0 :(得分:1)
在第一个标签中,有一个多余的括号
<div class="page-tabs">
<ul class="nav nav-tabs">
@if (!Model.OriginalWork.IsNew)
{
<li class='@(ViewBag.IsAmendment == "0" ? "active" : "")'>
<a href='@Url.Action("ReviewDetails", "SongsManagement", new { isAmendment = 0
})' title="Original">Original</a>
</li>
<li class='@(ViewBag.IsAmendment == "1" ? "active" : "")'>
<a href='@Url.Action("ReviewDetails", "SongsManagement", new { isAmendment = 1 })' title="Amendment">Active Amendment</a>
</li>
}
</ul>