我已经回顾了很多解决方案,其中大多数是jQuery ..我不知道如何检查模态是否打开...实际上我想在模态打开后呈现列表是否有任何方法在剃刀中执行此操作....
<div class="modal fade popup-modal" id="myModalMembers" role="dialog" style="margin-top: 50px;height: 267px;">
<div class=" modal-dialog modal-popup" style="height: 100%;">
<!-- Modal content-->
<div class="modal-content content-popup" style="height: 100%;">
<div class="modal-header" style=" margin-top: -30px;border: none;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Choose a Member</h4>
<p>_________________________________________________________________________________________________________</p>
</div>
<br />
@if ( $('#myModal').hasClass('in')) { // this is where i want to add conditon but i cant add like this there must a proper way to do so
@Html.DropDownListFor(m => m.MemberModel.SelectedMember, Model.MemberModel.Members, "-- Select Member --", new { @class = "form-control selector" })
}
<div class="modal-footer">
<input type="submit" value="Submit" name="memberSubmit" style="width: 100px;height: 30px;background-color: #254f91;" />
</div>
</div>
</div>
</div>