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 >