title: DropDownList Value not changing with UpdatePanel and ModalPopupExtender
body: <p>Greetings,</p>
  
  <p>I have an asp.net webpage with an modalpopupextender inside of an updatepanel. When I click Ok on the popup, I can get the textbox values from the popup just fine, but the DropDownLists have the old/default value, not the new value I have selected for them.</p>
  
  <p>All the controls on the popup are set to enableviewstate = true, and autopostback = false (I just want to make the trip to the server when I click the ok button, not every time I change the value of the popups).</p>
  
  <p>Here is the relevant code.</p>
  
  <p>==========================</p>
  
  <h1>Client Side</h1>
  
  <pre><code>    &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
      &lt;ContentTemplate&gt;
  
  
          &lt;asp:Panel ID="EditIssuePanel" runat="server" CssClass="modalPopup" Style="display:block;" &gt;
  
              &lt;table style="width:500px;"&gt;
                  &lt;tr style="height:50px;"&gt;
                      &lt;td colspan="2" align="center"&gt;
                          &lt;asp:Label ID="lblEditIssueHeader" runat="server" Text="Edit Issue"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn"&gt;
                          &lt;asp:Label ID="lblIssueName" runat="server" Text="Name:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:TextBox ID="txtName" runat="server" Width="250px" MaxLength="50"&gt;&lt;/asp:TextBox&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn"&gt;
                          &lt;asp:Label ID="lblDescription" runat="server" Text="Description:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:TextBox ID="txtDescription" runat="server" Width="250px" MaxLength="1000"&gt;&lt;/asp:TextBox&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn"&gt;
                          &lt;asp:Label ID="lblType" runat="server" Text="Type:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:DropDownList ID="ddlType" runat="server"&gt;
                              &lt;asp:ListItem Selected="True" Value="B"&gt;Bug&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="R"&gt;Request&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="O"&gt;Other&lt;/asp:ListItem&gt;
                          &lt;/asp:DropDownList&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn"&gt;
                          &lt;asp:Label ID="lblStatus" runat="server" Text="Status:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:DropDownList ID="ddlStatus" runat="server"&gt;
                              &lt;asp:ListItem Selected="True" Value="L"&gt;Logged&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="I"&gt;In Process&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="C"&gt;Complete&lt;/asp:ListItem&gt;
                          &lt;/asp:DropDownList&gt;
                          &amp;nbsp;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn"&gt;
                          &lt;asp:Label ID="lblPriority" runat="server" Text="Priority:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                              &lt;asp:DropDownList ID="ddlPriority" runat="server" EnableViewState="true" AutoPostBack="false"&gt;
                              &lt;asp:ListItem Selected="True" Value="L"&gt;Low&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="M"&gt;Medium&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Value="H"&gt;High&lt;/asp:ListItem&gt;
                          &lt;/asp:DropDownList&gt;
                          &amp;nbsp;&lt;/td&gt;   
                  &lt;/tr&gt;
                  &lt;tr style="height:30px"&gt;
                      &lt;td class="labelscolumn"&gt;Logger&lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:Label ID="lblEnteredByClientUserID" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn"&gt;
                          &lt;asp:Label ID="lblDateResolutionRequested" runat="server" Text="Requested Complete Date:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;igsch:WebDateChooser ID="wdcRequestCompleteDate" runat="server"&gt;
                          &lt;/igsch:WebDateChooser&gt;
                          &amp;nbsp;&lt;/td&gt;
  
                  &lt;/tr&gt;
                  &lt;tr style="height:30px"&gt;
                      &lt;td class="labelscolumn"&gt;Logged Date&lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:Label ID="lblLoggedDate" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px"&gt;
                      &lt;td class="labelscolumn"&gt;In Process Date&lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:Label ID="lblInProcessDate" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px"&gt;
                      &lt;td class="labelscolumn"&gt;Resolved Date&lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:Label ID="lblResolvedDate" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr style="height:30px;"&gt;
                      &lt;td class="labelscolumn" valign="top"&gt;
                          &lt;asp:Label ID="lblEmailCCList" runat="server" Text="Email CC:"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td class="datacolumn"&gt;
                          &lt;asp:TextBox ID="txtEmailCCList" runat="server" MaxLength="2000" Rows="0" 
                              TextMode="MultiLine" Height="83px" Width="250px"&gt;&lt;/asp:TextBox&gt;
                          &amp;nbsp;&lt;/td&gt;
  
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;asp:Label ID="lblIssueID" runat="server" Text="" Visible="false"&gt;&lt;/asp:Label&gt;
                          &lt;asp:Label ID="lblClientID" runat="server" Text="" Visible="false"&gt;&lt;/asp:Label&gt;
                      &lt;/td&gt;
                      &lt;td align="right"&gt;
                          &lt;asp:Button ID="btnEditOk" runat="server" Text="Ok" onclick="btnEditOk_Click"/&gt;&amp;nbsp;&amp;nbsp;
                          &lt;asp:Button 
                              ID="btnEditCancel" runat="server" Text="Cancel" onclick="btnEditCancel_Click" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
                      &lt;/td&gt;
  
                  &lt;/tr&gt;
              &lt;/table&gt;
  
          &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>
  . . . THEN THERE IS A WEBGRID HERE. . .</p>
  
  <p>This modal popupextender here got mangled. I cant get stackoverflow to show it right.
  It shows the properties here though.
  " 
          BackgroundCssClass="modalBackground"
          DropShadow="true" 
          OkControlID="btnEditOk" 
          CancelControlID="btnEditCancel" Animations="">
                  </p>
  
  <pre><code>        &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>=========================================</p>
  
  <h1>Server Side</h1>
  
  <p>protected void btnEditOk_Click(object sender, EventArgs e)
      {
          IssueDAO issueDAO = new IssueDAO();</p>
  
  <pre><code>    string client = "Eichleay";
      string name = null;
      string description = null;
      string type = null;
      string status = null;
      DateTime? resolvedDate = null;
      string enteredByClientUserName = User.Identity.Name.ToString();
      DateTime? loggedDate = DateTime.Now;
      DateTime? inProcessDate = null;
      DateTime? completeDate = null;
      DateTime? requestCompleteDate = null;
      string priority = null;
      int? prioritySort = null;
      string emailCCList = null;
  
      name = txtName.Text.Substring(txtName.Text.Length &gt; 0 ? 1 : 0, (txtName.Text.Length &gt; 0 ? txtName.Text.Length : 1) - 1);
      description = txtDescription.Text.Substring(txtDescription.Text.Length &gt; 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1);
      type = ddlType.SelectedValue;
      status = ddlStatus.SelectedValue;
      resolvedDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblResolvedDate.Text));
      inProcessDate = string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblInProcessDate.Text));
      completeDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblResolvedDate.Text));
      requestCompleteDate = wdcRequestCompleteDate.Value == null ? null : string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString()));
      priority = ddlPriority.SelectedValue;
      emailCCList = txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length &gt; 0 ? 1 : 0, (txtEmailCCList.Text.Length &gt; 0 ? txtEmailCCList.Text.Length : 1) - 1);
  
      if (lblEditIssueHeader.Text.Substring(0, 3) == "New")
      {
          issueDAO.InsertIssue(client,
                               name,
                               description,
                               type,
                               status,
                               resolvedDate,
                               enteredByClientUserName,
                               loggedDate,
                               inProcessDate,
                               completeDate,
                               requestCompleteDate,
                               priority,
                               prioritySort,
                               emailCCList);
      }
      else
      {
          Issue issue = new Issue(Convert.ToInt32(lblIssueID.Text), 
                                  lblClientID.Text, 
                                  txtName.Text.Substring(txtName.Text.Length &gt; 0 ? 1 : 0, (txtName.Text.Length &gt; 0 ? txtName.Text.Length : 1) - 1), 
                                  txtDescription.Text.Substring(txtDescription.Text.Length &gt; 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1), 
                                  ddlType.SelectedValue, 
                                  ddlStatus.SelectedValue, 
                                  string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblResolvedDate.Text)), 
                                  lblEnteredByClientUserID.Text, 
                                  string.IsNullOrEmpty(lblLoggedDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblLoggedDate.Text)), 
                                  string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblInProcessDate.Text)), 
                                  string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(lblResolvedDate.Text)), 
                                  string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable&lt;DateTime&gt;(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())), 
                                  ddlPriority.SelectedValue, 
                                  null, 
                                  txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length &gt; 0 ? 1 : 0, (txtEmailCCList.Text.Length &gt; 0 ? txtEmailCCList.Text.Length : 1) - 1));
  
          issueDAO.UpdateIssue(issue);
      }
  
      //        wdgIssues.ClearDataSource();
      //        UpdatePanel1.Update();
  
      lblIssueID.Text = null;
      lblClientID.Text = null;
      txtName.Text = null;
      txtDescription.Text = null;
      ddlType.SelectedValue = null;
      ddlStatus.SelectedValue = null;
      lblLoggedDate.Text = null;
      lblInProcessDate.Text = null;
      lblResolvedDate.Text = null;
      wdcRequestCompleteDate.Value = null;
      ddlPriority.SelectedValue = null;
      txtEmailCCList.Text = null;
  }
  </code></pre>