Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
haii..in my code I add the Ajax water mark extender ,but it does't work..here is the code...
XML
<asp:ToolkitScriptManager ID="tsmMachine" runat="server">
                           </asp:ToolkitScriptManager>


XML
<span class="labelbox">
                                    <asp:Label ID="lblMainDisplay" runat="server" Text="Main Display"></asp:Label>
                                </span><span class="field">
                                    <asp:TextBox ID="txtMainDisplay" runat="server" CssClass="textbox" MaxLength="17"></asp:TextBox>
                                    <asp:TextBoxWatermarkExtender ID="tweMainDisplay" runat="server" WatermarkText="Up to 17 characters"
                                        WatermarkCssClass="watermarknormal" TargetControlID="txtMainDisplay">
                                    </asp:TextBoxWatermarkExtender>
                                </span>
                                <span class="labelvalidate">
                                    <asp:RequiredFieldValidator ID="rfvMainDisplay" runat="server" ErrorMessage="*" ControlToValidate="txtMainDisplay"
                                        SetFocusOnError="true" ValidationGroup="MachineDetails"></asp:RequiredFieldValidator>
                                </span>



have any error? plx help...
Posted
Comments
Mohamed Mitwalli 1-Nov-12 4:10am    
Well I test your code and it's work fine with IE , firefox ,netscape ,safari ,Opera etc ..............

1 solution

Have you added the Ajax toolkit to your page?I mean the dll! :) TextBoxWatermarkExtender AJAX extender can be attached to an ASP.NET TextBox control to get "watermark" behavior. When a watermarked TextBox is empty, it displays a message to the user with a custom CSS style(i.e your css file)The asp:TextBoxWatermarkExtender has the following main properties given below:
TargetControlID - The ID of the TextBox(name of the textbox where you want the watermark) to operate on.
WatermarkText - The text to show when the control has no value.(default text as watermark)
WatermarkCssClass - The CSS class to apply to the TextBox when it has no value.
<pre lang="vb"><ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" runat="server"
    TargetControlID="TextBox Name"
    WatermarkText="Watermark text"
    WatermarkCssClass="watermarked" />

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900