When I open Modal the second time, the audio element remains the same.
I've uploaded new audio and still continues the old audio.
Please follow my code below.
<div class="col-xs-6">
@Html.LabelFor(model => model.Voice )
<br />
@Html.TextBoxFor(model => model.Voice, new { @class = "form-control", @type = "file" })
</div>
Html5 Audio:
<audio controls style="width: 400px;">
<source src="@Url.Action("StreamUploadedSong")" type="audio/mp3" />
Your browser does not support the audio element.
</audio>
Javascript:
$(function () {
$.ajaxSetup({ cache: false });
$("a[data-modal]").on("click", function (e) {
//hide dropdown if any (this is used wehen invoking modal from link in bootstrap dropdown )
//$(e.target).closest('.btn-group').children('.dropdown-toggle').dropdown('toggle');
$('#myModalContent').load(this.href, function () {
$('#myModal').modal({
//backdrop: 'static',
keyboard: true
}, 'show');
//bindForm(this);
});
return false;
});
});
The problem is:
public FileStreamResult StreamUploadedSong() // não entra aqui na segunda vez com modal bootstrap
{
}
On the second time, it should enter Public StreamUploadedSong ()
Why are not you working right?