title: Label inside UpdatePanel will not show value assigned from code-behind
body: <p>I'm at my wits end here. I've defined a user control for a modal that lets users change a password. Inside the modal, the fields are contained in an UpdatePanel, and I'd like to display a success/error message regarding the result of the password change request. However, the Label controls simply will not change.</p>
  
  <p>Markup:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var reqValidator1;
      var reqValidator2;
      var regValidator;
      var compValidator;
  
      function configPasswordValidators() {
          reqValidator1 = $("#&lt;%= RequiredFieldValidator1.ClientID %&gt; ")[0];
          reqValidator2 = $("#&lt;%= RequiredFieldValidator2.ClientID %&gt; ")[0];
          regValidator = $("#&lt;%= RegularExpressionValidator1.ClientID %&gt; ")[0];
          compValidator = $("#&lt;%= CompareValidator1.ClientID %&gt; ")[0];
      }
  
      function enablePasswordValidators() {
          ValidatorEnable(reqValidator1, true);
          ValidatorEnable(reqValidator2, true);
          ValidatorEnable(regValidator, true);
          ValidatorEnable(compValidator, true);
      }
  
      function disablePasswordValidators() {
          ValidatorEnable(reqValidator1, false);
          ValidatorEnable(reqValidator2, false);
          ValidatorEnable(regValidator, false);
          ValidatorEnable(compValidator, false);
      }
  
      function showProcessingSpinner() {
          $("#dvChangeUserPasswordBtns").hide();
          $("#dvProcessing").show();
          $("#&lt;%= btnChange.ClientID %&gt;").click();
      }
  &lt;/script&gt;
  &lt;div class="new-container new-modal" id="newContainerPanel"&gt;
      &lt;div runat="server" id="credentialManagerModal" class="new-container-inner panel panel-default" style="width: 600px;"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="modal-title"&gt;Change Password&lt;/h4&gt;
          &lt;/div&gt;
          &lt;asp:UpdatePanel runat="server" ID="upnlChangePassword" ChildrenAsTriggers="true" UpdateMode="Always"&gt;
              &lt;ContentTemplate&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-3 text-right" style="width: 160px; padding-top: 15px"&gt;
                              &lt;asp:Label ID="lblPassword1" runat="server" /&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-5" style="margin-left: -20px; margin-right: -20px; padding-top: 8px"&gt;
                              &lt;asp:TextBox ID="txtPassword1" runat="server" TextMode="Password" MaxLength="100" Width="260px" CssClass="form-control" /&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-4" style="padding-top: 15px;"&gt;
                              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="password" runat="server" ControlToValidate="txtPassword1" SetFocusOnError="true" Display="Dynamic" Enabled="false" Style="margin-left: 40px; color: red;"&gt;&lt;/asp:RequiredFieldValidator&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row" style="margin-top: 15px;"&gt;
                          &lt;div class="col-md-3 text-right" style="width: 160px; padding-top: 7px;"&gt;
                              &lt;asp:Label ID="lblPassword2" runat="server" /&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-5" style="margin-left: -20px; margin-right: -20px;"&gt;
                              &lt;asp:TextBox ID="txtPassword2" runat="server" TextMode="Password" MaxLength="100" Width="260px" CssClass="form-control" /&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-4" style="padding-top: 7px;"&gt;
                              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="password" ControlToValidate="txtPassword2" SetFocusOnError="true" Display="Dynamic" Enabled="false" Style="margin-left: 40px; color: red;"&gt;&lt;/asp:RequiredFieldValidator&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row" style="padding-top: 15px; text-align: center;"&gt;
                          &lt;asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationGroup="password" runat="server" ControlToValidate="txtPassword1" SetFocusOnError="true" Display="Dynamic" Enabled="false" Style="margin-left: 30px; color: red;"&gt;&lt;/asp:RegularExpressionValidator&gt;
                          &lt;asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtPassword2" Operator="Equal" Type="String" ValidationGroup="password" ControlToCompare="txtPassword1" Display="Dynamic" EnableClientScript="true" Enabled="false" Style="margin-left: 20px; color: red;"&gt;&lt;/asp:CompareValidator&gt;
                      &lt;/div&gt;
                      &lt;div class="row text-center" style="margin-top: 15px;"&gt;
                          &lt;asp:Label runat="server" ID="lblChangePasswordSuccess" ForeColor="MediumSeaGreen"&gt;&lt;/asp:Label&gt;
                          &lt;asp:Label runat="server" ID="lblChangePasswordError" ForeColor="Red"&gt;&lt;/asp:Label&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div id="passwordModalFooter" class="modal-footer"&gt;
                      &lt;div id="dvChangeUserPasswordBtns" class="text-center"&gt;
                          &lt;button id="btnClose" class="btn btn-default" onclick="HideChangePasswordModal();" style="float: left;"&gt;Cancel&lt;/button&gt;
                          &lt;button id="btnProcessChange" runat="server" class="btn btn-primary" onclick="showProcessingSpinner();" style="float: right;"&gt;Change Password&lt;/button&gt;
                      &lt;/div&gt;
                      &lt;div class="text-center" id="dvProcessing" style="display: none;"&gt;
                          &lt;img src="../Images/progress-spinner.gif" /&gt;&amp;nbsp;Processing... 
                      &lt;/div&gt;
                      &lt;div style="display: none"&gt;
                          &lt;asp:Button ID="btnChange" runat="server" CssStyle="btn btn-primary change-password-button" OnClick="ChangePassword_Click" CausesValidation="true" ValidationGroup="password" /&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>protected void ChangePassword_Click(object sender, EventArgs e)
  {
      string retVal = ChangePassword(Request.QueryString["ID"]); // Separate processing method that is working fine.
  
      if (retVal == "Password changed.")
      {
          lblChangePasswordSuccess.Text = retVal;
          lblChangePasswordError.Text = string.Empty;
      }
      else
      {
          lblChangePasswordSuccess.Text = string.Empty;
          lblChangePasswordError.Text = retVal;
      }
  }
  </code></pre>
  
  <p>ScriptManager in the master page looks like this: </p>
  
  <pre><code>&lt;asp:ScriptManager ID="ScriptManagerMain" runat="server" EnablePageMethods="True" EnablePartialRendering="True" LoadScriptsBeforeUI="true"&gt;
  </code></pre>
  
  <p>What I've tried:</p>
  
  <ul>
  <li><p>Changing around the <code>UpdatePanel</code> attributes. Doesn't matter if I use <code>ChildrenAsTriggers="true"</code> or define the triggers manually. Doesn't matter if I use "Always" or "Conditional" for the <code>UpdateMode</code>.</p></li>
  <li><p>Calling <code>UpdatePanel1.Update()</code> from the code behind has no effect.</p></li>
  <li><p>Trying to edit the label (or any other element type I put in its place) via a javascript call doesn't work either. Something like <code>ScriptManager.RegisterStartupScript(upnlChangePassword, this.GetType(), "script", string.Format("DisplayProcessingMessage('{0}');", retVal), true);</code> has no effect.</p></li>
  </ul>
  
  <p>I've stepped through the code over and over—all events are firing correctly and the correct values are being returned. I've inspected the DOM before and after the partial postback and the element is always unchanged. There are no javascript errors detected in the browser.</p>
  
  <p>This sits in a user control inside a web form that utilizes a master page. In the browser, there is far more in the page than would be useful to post here, so I recognize there could be something outside this file in play. But if I could at least have an idea of what to look for that could cause this behavior, it would be an enormous help.</p>