title: Bootstrap modal popup doesn't work
body: <p>I have the following code to display a bootstrap modal popup in a webforms application with a master page. This works fine on a small one-page test site. But when I move it to my actual site, somehow the popup doesn't show up. There are no javascript errors for me to debug. I have moved around, the javascript code to master page's head and also the modal popup div to the master page's body. Still the popup doesn't show!</p>
  
  <p>aspx page:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"&gt;
    &lt;style&gt;
      .vertical-alignment-helper {
        display: table;
        height: 100%;
        width: 100%;
      }
  
      .vertical-align-center {
        /* To center vertically */
        display: table-cell;
        vertical-align: middle;
      }
    &lt;/style&gt;
    &lt;script type="text/javascript"&gt;
      function ShowPopup() {
        $("#btnShowPopup").click();
      }
  
      function btnRedirect_Click() {
        window.location.replace("Redirected.aspx?
          FirstName = John &amp; LastName = Velu ");
        }
    &lt;/script&gt;
    &lt;br/&gt;
    &lt;br/&gt;
    &lt;div class="row"&gt;
      &lt;div class="col-md-4"&gt;
        &lt;asp:Button runat="server" Text="Display Popup" OnClick="OnClick" /&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="modal fade" id="myModal" data-backdrop="static" data- keyboard="false"&gt;
      &lt;div class="vertical-alignment-helper"&gt;
        &lt;div class="modal-dialog vertical-align-center"&gt;
          &lt;div class="modal-content "&gt;
            &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                          &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
              &lt;h4 class="modal-title" style="color: white"&gt;
                Test&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
              &lt;asp:Label ID="lblMessage" runat="server" Text="Testing..." /&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
              &lt;button type="button" class="btn btn-primary" id="btnRedirect" OnClick="Javascript:btnRedirect_Click();"&gt;
                          Redirect&lt;/button&gt;
              &lt;button type="button" class="btn btn-default" data- dismiss="modal"&gt;
                          Close&lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;button type="button" style="display: none;" id="btnShowPopup" class="btn 
        btn-primary btn-lg" data-toggle="modal" data-target="#myModal"&gt;       
       &lt;/button&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Code-behind</p>
  
  <pre><code> protected void btnLogin_Click(object sender, EventArgs e)
   {
      Response.Redirect("Redirected.aspx");
   }
  
   protected void OnClick(object sender, EventArgs e)
   {
     ClientScript.RegisterStartupScript(this.GetType(), "alert", 
     "ShowPopup();", true);            
     return;
   }
  </code></pre>