title: Adding attributes to textbox at runtime from C#
body: <p>I am trying to add attributes text a textbox at runtime as shown in the example below. The code below works, but the attributes only take effect after a full postback and I'm doing partial postbacks.</p>
  
  <p>txtSKU1 is inside of an update panel which updates other textboxes, as seen in the  <code>DisplaySKUInfo</code> and <code>ClearSKUInfo</code> functions. That works great - but the attributes I am trying to add only work after a full postback - is there a way to reload the control without doing a full?</p>
  
  <pre><code>    protected void txtSKU1_TextChanged(object sender, EventArgs e)
      {
          if (sql.OpenConnection())
          {
              SKUInformation sku = sql.GetSKUInformation(txtSKU1.Text);
  
              if (sku.IsValid)
              {
                  DisplaySKUInfo(sku.SKU, txtComp1, txtCost1, txtDescription1, txtMargin1);
  
                  txtSKU1.Attributes.Remove("class");
                  txtSKU1.Attributes.Remove("data-toggle");
                  txtSKU1.Attributes.Remove("data-placement");
              }
              else
              {
                  ClearSKUInfo(txtComp1, txtCost1, txtDescription1, txtMargin1);
  
                  // These only work after a full postback
                  txtSKU1.Attributes.Add("class", "popover-dismiss");
                  txtSKU1.Attributes.Add("data-toggle", "popover");
                  txtSKU1.Attributes.Add("data-placement", "top");
              }
          }
      }
  </code></pre>