TextBoxWatermark (watermark text box) control in the AJAX control set, asp. netajax Control

Source: Internet
Author: User

TextBoxWatermark (watermark text box) control in the AJAX control set, asp. netajax Control

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.


In VS2008, when AJAX control is used, does it not produce any effect after running?

<Asp: TextBox ID = "txtDeptSearch" runat = "server"> </asp: TextBox> <ajaxToolkit: textBoxWatermarkExtender ID = "txtDeptSearch_TextBoxWatermarkExtender" runat = "server" Enabled = "true" TargetControlID = "txtDeptSearch" WatermarkText = "Enter the Department name to search! "SkinID =" TextBoxWatermarkExtender "> </ajaxToolkit: TextBoxWatermarkExtender>

How can I use TextBoxWatermarkExtender1, a watermark control in AjaxControlToolkit?

Related Article

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.