Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to Display popup from external html file?

$
0
0

Hi

In my view, i have button which display a popup from external html as template. here is my code :

my view code :

<button type="button" id="btnNew" class="btn btn-success btn-sm" onclick="showDialog()">Create new</button><div id="divPopup"></div>

Here is my javascript function (showDialog) :

function showDialog() {    $('#divPopup').load('/Templates/ModalForm1.html');$('#myModal').modal('show');
}

And here is my external html file (ModalForm1.html) :

<!-- Modal --><div id="myModal" class="modal fade" role="dialog" data-backdrop="static"><div class="modal-dialog"><!-- Modal content--><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal">&times;</button><h4 class="modal-title">New order</h4></div><div id="myModalBody" class="modal-body"><p>Some text in the modal.</p></div></div></div></div>

But my code not working correctly. Can anybody help me how to solve my problem?

Thanks in advance


Viewing all articles
Browse latest Browse all 9386

Trending Articles