How to set custom click event handler for data-toggle="modal" button without opening modal dialog?
<p>I have a <code>$.post()</code> request named "HasIncreasePoint" and if the data returned from server indicates a success (<code>e.IsSuccess</code>), I want not to open the bootstrap modal dialog, and accomplish the click event process.</p>

<pre><code>$('a[data-toggle="modal"]').on('click', function (event) {
    $.post("@Url.Action("HasIncreasePoint")", function (e){
        if (e.IsSuccess) {
            alert("error!please not to open the modal!");
            event.preventDefault();
            event.stopPropagation();
            $('a[data-toggle="modal"]').off("click");
        }else{
            // From the clicked element, get the data-target arrtibute
            // which BS3 uses to determine the target modal
            var target_modal = $(e.currentTarget).data('target');
            // also get the remote content's URL
            var remote_content = e.currentTarget.href;

            // Find the target modal in the DOM
            var modal = $(target_modal);
            // Find the modal's &lt;div class="modal-body"&gt; so we can populate it
            var modalBody = $(target_modal + ' .modal-body');

            // Capture BS3's show.bs.modal which is fires
            // immediately when, you guessed it, the show instance method
            // for the modal is called
            modal.on('show.bs.modal', function () {
                // use your remote content URL to load the modal body
                modalBody.load(remote_content);
            }).modal();

            // and show the modal

            // Now return a false (negating the link action) to prevent Bootstrap's JS 3.1.1
            // from throwing a 'preventDefault' error due to us overriding the anchor usage.
            return false;
        }
    });
});
</code></pre>

<p>and the HTML code:</p>

<pre><code>&lt;a class="btn-check-in" href="@Url.Action("ReverseCard")"  data-toggle="modal" data-target="#myModal" id="btn-sign"&gt;
    &lt;i&gt;&lt;/i&gt;&lt;span&gt;SignIn&lt;/span&gt;
&lt;/a&gt;
</code></pre>