Posts

Showing posts from December, 2014

ASP.Net MVC: Loading Bootstrap Modal Dialog content with jquery ajax.

Whenever i tried t find how to load the bootstrap modal dialog content at runtime, i was unable to find proper solution anywhere.  One way to do it but in that you have no contrl over the error as bootstrap automatically do that.   $(".opentutorial").click(function (e) {             e.preventDefault();             $('#modalHelpDiv').load(anyurl);             $('#modalHelpDiv').modal({ show: true, keyboard: false });             //.dialog(opt).dialog("open");         }); Second way is this and as per me this second way is the best. <div id="modalDiv" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-href="anyurl"></div> $('.previewbtn').click(function () {                 var url = $(this).attr('data-href'); ...