我在asp mvc中有一个局部视图,默认情况下,我使用类show
显示折叠:
<div class="card-header toggleable checkoutheader" data-toggle="collapse" data-target="#latestticketdatabody"><strong>Latest Tickets</strong></div>
<div class="card-body text-primary collapse show" id="latestticketdatabody" style="cursor: default;" data-parent="#accordion">
@{ Html.RenderPartial("~/Areas/Personal/Views/Shared/Partials/PartialPersonalLatestTicketBody.cshtml"); }
</div>
这很好!
在另一个局部视图中,我正在尝试相同的操作,但是加载页面时不存在类show
。这是无法正常工作的视图的代码:
<div class="row">
<div class="col-lg-1"></div>
<div class="col-lg-10" style="text-align: center;">
<button type="button" data-toggle="collapse" data-target="#deliveryaddress" class="btn btn-secondary btn-block deliverybutton">Abweichende Lieferanschrift?</button>
</div>
<div class="col-lg-1"></div>
</div>
<div class="collapse show" id="deliveryaddress">
@{ Html.RenderPartial("~/Areas/Checkout/Views/Shared/Partials/PartialCheckoutDeliveryAddress.cshtml"); }
</div>
当我单击按钮时,该区域将打开,并且一切正常。但是,为什么在页面加载时和其他视图一起使用时,类show
却被删除了?