title: Bootstrap modal
body: <p>I'm building a mobile application using asp.net (aspx) and modal bootstrap.
  The purpose of this modal is to fill a label with the information contained in the "data-marcacao" attribute of the href that triggers this modal. When the modal is triggered on the 1st attempt the label is not being filled. The label is being populated only in the 2nd attempt to open the modal after the "Yes" myButton has been clicked on the 1st attempt.</p>
  
  <pre><code>//triggered
  &lt;a href="#" data-toggle="modal" data-target="#myModal" data-marcacao="frase qualquer"&gt;
  
  //modal
      &lt;div class="modal fade" id="myModal"&gt;
          &lt;div class="modal-dialog"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;asp:Label ID="lblModalMarcacao" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button class="btn btn-success btn-md" id="myButton"&gt;Sim&lt;/button&gt;
                      &lt;button class="btn btn-danger btn-md" data-dismiss="modal"&gt;Não&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  //script
      &lt;script type="text/javascript"&gt;
              $('#myModal').modal({ backdrop: 'static', keyboard: false });
              $('#myModal').modal('toggle');
              $('#myModal').modal('handleUpdate');
  
              $(document).ready(function () {
                  $("a").on("click", function (e) {
                      e.preventDefault();
                      $('#lblModalMarcacao').text('Marcação: ' + $(this).attr("data-marcacao"));
                  });
              });
      };
  &lt;/script&gt;
  </code></pre>