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:
<asp:TextBox ID="TextBox1" runat="server" CssClass="text" />
<ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1" WatermarkCssClass="watermark" />
<input type="text" class="text" />
becomes
<input type="text" class="watermark" />
when the watermark style is in effect rather than
<input type="text" class="text watermark" />
The workaround is to set the WatermarkCssClass property to include both classes:
<asp:TextBox ID="TextBox1" runat="server" CssClass="text" />
<ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1" WatermarkCssClass="text watermark" />
Comments: This wouldn't work in case you want to add any TextBox css class runtime by using Javascript or jQuery.
<asp:TextBox ID="TextBox1" runat="server" CssClass="text" />
<ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1" WatermarkCssClass="watermark" />
<input type="text" class="text" />
becomes
<input type="text" class="watermark" />
when the watermark style is in effect rather than
<input type="text" class="text watermark" />
The workaround is to set the WatermarkCssClass property to include both classes:
<asp:TextBox ID="TextBox1" runat="server" CssClass="text" />
<ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1" WatermarkCssClass="text watermark" />
Comments: This wouldn't work in case you want to add any TextBox css class runtime by using Javascript or jQuery.