I have this view with a modal window. When I click to open the modal window, I\'d like to pass the parameter item.InstrumentId
into the modal window so that I can c
1.Use ID
for Anchor Link.
2.Notice this line Anchor Link Value=
in code. It has Anchor Link Value=
. When you open modal you can see Anchor Link Value=10320320
and you can inspect href
too.
$('#myModal1').on('show.bs.modal', function(e) {
var modalId = $(e.relatedTarget).data('id');
$('#InstrumentIDLink').attr('href', 'url+'+ modalId)
$('#InstrumentIDLink').text('Anchor Link Value='+ modalId);
})
Modal Example
From bootstrap 3+ you can use e.relatedTarget
to get element that triggered the modal