title: Call multiple modal popups from webform in asp.net and c#
body: <p>I'm trying to call multiple modal popups  from a same webform, but I don't want to write them all in the same aspx file, so that's why I thought about using a masterpage.</p>
  
  <p>This is part of the code so far:</p>
  
  <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="Trabajadores.master.cs" Inherits="Trabajadores" %&gt;
  
  
      &lt;!-- Modal --&gt;
      &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
          &lt;div class="modal-dialog" role="document"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;asp:ContentPlaceHolder ID="Modal" runat="server"&gt;
                  &lt;/asp:ContentPlaceHolder&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- Modal --&gt;
  
  
                  &lt;ul class="nav nav-pills nav-stacked small"&gt;
                      &lt;li&gt;&lt;a href="~/Empresas/Trabajadores/Ventanas/Empresas.aspx" data-toggle="modal" data-target="#myModal"&gt;Empresas&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="~/Empresas/Trabajadores/Ventanas/Obras.aspx" data-toggle="modal" data-target="#myModal"&gt;Obras&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="~/Empresas/Trabajadores/Ventanas/Haberes.aspx" data-toggle="modal" data-target="#myModal"&gt;Haberes&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="~/Empresas/Trabajadores/Ventanas/Descuentos.aspx" data-toggle="modal" data-target="#myModal"&gt;Descuentos&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
  </code></pre>
  
  <p>And this is one of the modal popups:</p>
  
  <pre><code>&lt;%@ Page Title="Haberes" Language="C#" MasterPageFile="~/Trabajadores.Master" AutoEventWireup="true" CodeFile="Haberes.aspx.cs" Inherits="Empresas_Trabajadores_Ventanas_Haberes" %&gt;
  
  &lt;asp:Content ID="BodyContent" ContentPlaceHolderID="Modal" runat="server"&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" id="myModalLabel"&gt;Login&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;form&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label&gt;Email address&lt;/label&gt;
                          &lt;input type="email" class="form-control" placeholder="Enter Email"&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label&gt;Password&lt;/label&gt;
                          &lt;input type="password" class="form-control" placeholder="Enter Password"&gt;
                      &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
                  &lt;/div&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>But it's not working. However, I think if I use a masterpage it will redirect the page in order to open a modal popup, so I'm wondering if there is a way to open multiple modal popups without redirecting the page (so maybe I should not use a materpage, but a c# function instead).</p>