我正在使用手风琴来切换显示 onclick。如果我使用简单的文本,它可以正常工作。现在我想在其中加入一个链接。所以我的原始代码是这样的。
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#@item.Id.ToString()">
<div class="data-table">
<div class="pull-left">
<p class="ptitle">Document Package @item.Id.ToString()<br /><span class="psubtitle">Date Created: @item.CreatedAt.ToString()</span><br /><span class="psubtitle">Date Updated: @item.UpdatedAt.ToString()</span></p>
</div>
<div class="pull-right accordion-downarrow"><span class="glyphicon glyphicon-chevron-down"></span></div>
<div class="pull-right text-center"><p>PP<br /><span class="label label-warning"> </span></p></div>
<div class="pull-right text-center"><p>AMG<br /><span class="label label-danger"> </span></p></div>
<div class="clearfix"></div>
</div>
</a>
</div>
我想改变这一行:
<p class="ptitle">Document Package @item.Id.ToString()<br /><span class="psubtitle">Date Created: @item.CreatedAt.ToString()</span><br /><span class="psubtitle">Date Updated: @item.UpdatedAt.ToString()</span></p>
变成这样的事情。
<p class="ptitle">@Html.ActionLink("Document Package " + item.Id.ToString(), "show", "documentpackage", new { id = item.Id }, null)<br /><span class="psubtitle">Date Created: @item.CreatedAt.ToString()</span><br /><span class="psubtitle">Date Updated: @item.UpdatedAt.ToString()</span></p>
当我将其更改为链接时。手风琴的功能停止,但链接有效。我想让链接工作,同时保留手风琴切换的功能。有任何想法吗?谢谢!