I realize that this could be repetitive question but I failed to find an answer so putting a new question. I am pretty new to web development and trying to hard to get this trivial scenario work: I want to display some information to the user when he clicks on a button. The information should be presented like a popup: it would close only when user clicks on close(X
) on top right or ok
button at bottom. I have tried implementing this using different ways I came across on various SO answers but nothing seems to work for me. Following code snippet that displays a static modal works:
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">Launch demo modal</button>
<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
But I am not able to convert things to display my partial view. How do I display a similar modal which actually encompasses a partial view?