title: Bootstrap Modal Popup in ASP.Net C#
body: <p>I have a bootstrap modal popup that has bound data to the asp.net dropdown ( inside the modal ). Now I want to save the selected value into database. My problem is the selected value of the dropdown is not getting passed in the aspx.cs (code behind ) page.</p>
  
  <p>Modal</p>
  
  <pre><code>&lt;div id="myModal" class="modal fade" tabindex="-1" data-width="760" style="display: none;"&gt;                    
  
     &lt;div class="modal-header"&gt;
                              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;
                                  &amp;times;
  
                              &lt;/button&gt;
                              &lt;h4 class="modal-title"&gt;am/pm/fd&lt;/h4&gt;
                          &lt;/div&gt;
  
                          &lt;div class="modal-body"&gt;
                              &lt;div class="row"&gt;
                                  &lt;div class="col-sm-9"&gt;
                                      &lt;h4&gt;Please select one&lt;/h4&gt;
                                      &lt;table class="nav-justified"&gt;
                                          &lt;tr&gt;
                                              &lt;td&gt;
                                                  &lt;asp:DropDownList ID="drpColor" runat="server" class="form-control" onclick="add()"&gt;
                                                  &lt;/asp:DropDownList&gt;
                                              &lt;/td&gt;
                                          &lt;/tr&gt;
                                      &lt;/table&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="modal-footer"&gt;
                              &lt;asp:Button ID="btnAdd" runat="server" Text="Add" class="btn btn-primary" OnClick="btnAdd_Click" UseSubmitBehavior="false" data-dismiss="modal" /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>JQuery</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#myModal").modal('show');
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Code Behind</p>
  
  <pre><code>    protected void btnAdd_Click(object sender, EventArgs e)
      {
       // here i don't get the selected value of the dropdown .that means                   drpColor.SelectedValue = "" ; // I get "" instead of dropdowns selected value
      }
  </code></pre>