Problem when displaying modal bootstrap

0

I'm trying to display a bootstrap modal for the client, with an error message, my code looks like this:

@if (!string.IsNullOrWhiteSpace(Model.ErrorMessage))
{
    <script>
        $('#modalError').modal('show');
    </script>

}



<div id="modalError" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body">
                <p>@Model.ErrorMessage.</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
}

But this error message appears: "The object does not support the 'modal' property or method"

The jquery file is referenced on the normal page.

    
asked by anonymous 16.09.2016 / 01:00

1 answer

0

Hello, I do not know if I can help. But is this missing in the modal call:

$ (document) .ready (function () {

Good luck !!

    
16.09.2016 / 08:16