Textboxwatermark (watermark text box) Control of Ajax control set

Source: Internet
Author: User

Function:
The Textbox Control can have the watermark text during initialization.
Attribute:
Targetcontrolid: ID of the Textbox Control with watermark effect.
Watermarkcssclass: Specifies the CSS style sheet of the watermark text.
Watermarktext: the watermark text content displayed in the Textbox Control.

Code example:

 

<Asp: Panel id = "paninttemp" runat = "server" groupingtext = "add materials"> <Table> <tr> <TD> Name: </TD> <asp: textbox id = "txtintname" runat = "server"> </ASP: textbox> <ajaxtoolkit: textboxwatermarkextender id = "tbwetxtintname" runat = "server" targetcontrolid = "txtintname" watermarkcssclass = "watermarked" watermarktext = "enter your name here"> </ajaxtoolkit: textboxwatermarkextender> </TD> <TD> Gender: </TD> <asp: textbox id = "txtintgender" runat = "server"> </ASP: textbox> <ajaxtoolkit: textboxwatermarkextender id = "tbwetxtintgender" runat = "server" targetcontrolid = "txtintgender" watermarktext = "enter a gender here"> </ajaxtoolkit: textboxwatermarkextender> </TD> <tr> <TD> Date of Birth: </TD> <asp: textbox id = "txtintbirthday" runat = "server"> </ASP: textbox> <ajaxtoolkit: textboxwatermarkextender id = "tbwetxtintbirthday" runat = "server" targetcontrolid = "txtintbirthday" watermarkcssclass = "watermarked" watermarktext = "yyyymmdd"> </ajaxtoolkit: textboxwatermarkextender> </TD> <TD> Home address: </TD> <asp: textbox id = "txtintaddress" runat = "server"> </ASP: textbox> <ajaxtoolkit: textboxwatermarkextender id = "tbwetxtintaddress" runat = "server" targetcontrolid = "txtintaddress" watermarktext = "enter your home address"> </ajaxtoolkit: textboxwatermarkextender> </TD> </tr> </table> </ASP: Panel>
View code

Run:

The name and date of birth indicate the effect displayed in the CSS style sheet of the watermark text. This is very practical in actual programming.

As follows:

End:

This chapter describes how to use textboxwatermarkextender. This component is easy to use and can be used without writing any code. Or some friends may think that setting a default value for textbox can also serve as a prompt. The default value can only be used to set simple text, but cannot set the prompt style. When the input content is cleared again, the prompt cannot appear again unless it is assisted by Js. Textboxwatermarkextender allows you to achieve the desired effect with the fastest speed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.