how to fix foreachllop iframe

Dec 5 2017 1:10 PM
 how to fix  issueiframe whenever iam click open button iframe takes only first video in list
 
 
foreach (var item in Model)
{
ViewBag.TotalStudents = @item.TrailerURL;
<div class="col-lg-3">
@*// var [email protected]("/?autoplay=0", "");*@
@*<img src="@item.thumbnail" />*@
<button type="button" class="btn btn-info btn-lg" id="@item.id" data-toggle="modal" data-target="#myModal"> Modal</button>
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Small Modal</button>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<iframe id="iframemv" src="@item.TrailerURL"></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
}

Answers (2)