javascript - Bootstrap modal doesn't load properly -
i'm creating website in asp.net (framework 4.0).
a master page has required bootstrap files & jquery files added in it. files
<link href="../assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <script src="../styles/js/jquery-1.11.2.min.js" type="text/javascript"></script> <script src="../styles/js/bootstrap.min.js" type="text/javascript"></script>
bootstrap modal doesn't work on button click.
on child page button click should work.
child page code. (page1.aspx.cs)
protected void button1_click(object sender, eventargs e) { lblmodal2.text = "please add item cart"; scriptmanager.registerstartupscript(page, page.gettype(), "warning","$('#warning').modal();", true); }
child page (page1.aspx) bootstrap modal code follows.
<div class="modal fade" id="warning" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header modal-header-warning"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> ×</button> <h1> <i class="fa fa-exclamation-triangle"></i>warning </h1> </div> <div class="modal-body"> <asp:label id="lblmodal2" runat="server" text=""></asp:label> </div> <div class="modal-footer"> <button type="button" class="btn btn-default pull-left" data-dismiss="modal"> close</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div>
just add code line in css file.
.modal-backdrop { z-index: -1; }
Comments
Post a Comment