Ajax toolkit Control Learning Series (3) -- textboxwatermarkextender

Source: Internet
Author: User

Textboxwatermarkextender controls a textbox. You can set CSS to change the style. For example, it looks like at the beginning, and it looks like after the input. Before the data is processed, the default attribute value is controlled. When the cursor clicks the input, the displayed content disappears and your text is entered. In this example, two textbox boxes are used for comparison.

Let's look at the effect first.

Start, prompting you to enter the user name.

When you click the mouse, the prompt message is no longer displayed. You can enter it as needed.

Complete the input. The dialog box is displayed.

Textboxwatermarkextender has two necessary attributes: targetcontrolid. Needless to say, it controls the textbox ID. Watermarktext is the control prompt information.

We can also control the textbox style through watermarkcssclass. The input will disappear.

No in the backgroundCodeThe front-end code is as follows:

  <  Form  ID = "Form1"  Runat  = "Server"  >  
< Div >
< ASP: scriptmanager ID = "SM" Runat = "Server" >
</ ASP: scriptmanager >
< ASP: updatepanel ID = "Updatepanel1" Runat = "Server" >
< Contenttemplate >
< ASP: textbox ID = "Tb_username" Runat = "Server" Text = "" > </ ASP: textbox >
< Ajax: textboxwatermarkextender ID = "Tbwe_username" Runat = "Server" Targetcontrolid = "Tb_username"
Watermarktext = "Input your username ." Watermarkcssclass = "Textbox" >
</ Ajax: textboxwatermarkextender >
< BR />
< ASP: textbox ID = "Tb_psd" Runat = "Server" Text = "" Textmode = "Password" > </ ASP: textbox >
< BR />
< ASP: button ID = "Btn_login" Runat = "Server" Text = "Login" />
< Ajax: confirmbuttonextender ID = "Cbe_btn" Runat = "Server" Targetcontrolid = "Btn_login"
Confirmtext = "Welcome !! " >
</ Ajax: confirmbuttonextender >
</ Contenttemplate >
</ ASP: updatepanel >
</ Div >
</ Form >
 
 

 

 

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.