Auto Expand textbox does not work when using with CSS
For some reason the following code does not work if I use CSS in the AJAX TextWaterMark control.
- $(document).ready(function(){
- $('.expanding').autogrow();
- //use the following code if I figured out how to get jQuery to recognized repating same Div ID
- //$("#commands").hide("normal");
- });
And ASP.NET code:
- <asp:TextBox ID="txtNotes" runat="server" CssClass="expanding" Text='<%# Bind("notes") %>'
- TextMode="MultiLine" Width="96%" />
- <ajaxToolkit:TextBoxWatermarkExtender ID="txtNotes_TextBoxWatermarkExtender"
- runat="server" Enabled="True" TargetControlID="txtNotes"
- WatermarkCssClass="waterMarkTextBox"
- WatermarkText="Write your class notes here">
- </ajaxToolkit:TextBoxWatermarkExtender>
And my CSS:
- .waterMarkTextBox
- {
- height: 20px;
- padding-top: 4px; /*background-color: #C0D9D9;*/
- font: 10px Verdana, Arial, Helvetica, sans-serif;
- color: #7A8B8B;
- }
- .expanding
- {
- line-height: 20px;
- width: 400px;
- }
The auto expanding the TextBox control stops working as soon as I specify the WaterMarkCssClass.