Bootstrap stop Modal showing on page load

Posted by Subby on Stack Overflow See other posts from Stack Overflow or by Subby
Published on 2012-09-21T09:27:33Z Indexed on 2012/09/21 9:37 UTC
Read the original article Hit count: 166

Filed under:

I only want the Modal to show when I click on a certain button.

At the moment, the Modal shows itself whenever I load the page.

Can someone please tell me where I am going horribly wrong?

<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>


                <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">Modal header</h3>
                    </div>
                    <div class="modal-body">
                        <p>One fine body…</p>
                    </div>
                    <div class="modal-footer">
                        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
                        <button class="btn btn-primary">Save changes</button>
                    </div>
                </div>

I am using ASP.NET MVC 3

EDIT: I am NOT using any Javascript at the moment.

© Stack Overflow or respective owner

Related posts about bootstrap