title: TextBoxWatermarkExtender WatermarkCssClass overwrites TextBox CssClass
body: <p>If you set a CSS class on a TextBox control with the CssClass property, targeting that TextBox with the TextBoxWatermarkExtender that has a WatermarkCssClass property will cause it to lose its CSS class, i.e., it is reseting the class attribute to the watermark text, rather than adding it as an additional class:</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" CssClass="text" /&gt;
  &lt;ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1" WatermarkCssClass="watermark" /&gt;
  </code></pre>
  
  <p>as an output</p>
  
  <pre><code>&lt;input type="text" class="text" /&gt;
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>&lt;input type="text" class="watermark" /&gt;
  </code></pre>
  
  <p>when the watermark style is in effect rather than</p>
  
  <pre><code>&lt;input type="text" class="text watermark" /&gt;
  </code></pre>
  
  <p>Can anyone suggest the workaround?</p>
  
  <p>Please do not suggest below the workaround because I have a requirement to add TextBox CssClass run time. I have added TextBox CssClass by javascript but still TextBoxWatermarkExtender WatermarkCssClass overwrites the textbox classes.</p>
  
  <p>Set the WatermarkCssClass property to include both classes:</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" CssClass="text" /&gt;
  &lt;ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1" WatermarkCssClass="text watermark" /&gt;
  </code></pre>