Follow these easy steps to create your solution
1.
Start your Visual Studio 2005 IDE.
2.
Choose Create Web Site from the menu.
3.
In this sample application we will use the Visual Basic language for the
sample application.
4. Name
the solution TextBoxWatermarkSample.
5.
Choose ASP.NET AJAX Control Toolkit Web Site.
6.
Choose File System in the location box.
7.
Click OK to create the project.
8.
Visual Studio 2005 will create your project with a Default.aspx page and
likely a readme.txt. Go ahead and get rid of the latter file.
9.
Open Default.aspx page in design view.
10. You'll
notice that there is a control on the page already called script manager.
(Well, AJAX is really a script based implementation of the language
JavaScript.) In Short, Script Manager Control manages client script for Microsoft
ASP.NET AJAX pages. By default, the Script Manager control registers the script
for the Microsoft AJAX Library with the page. This enables client script to use
the type system extensions and to support features such as partial-page
rendering and Web-service
calls.
11. On
the design surface, under the script manager control, write the word Name: and drag a Textbox control.
12. Below
the first line, write the word Phone: and drag a Textbox
near it.
13. Create
a new style sheet (name it stylesheet.css) and insert the following code.
.watermark
{
background: #FFAAFF;
}
14. Open
the default.aspx page in source mode and drag the style sheet below the title
section to create a reference to it.
15. Back
into design mode, go to the Toolkit Toolbox and drag two Textbox watermarks
extenders and drop them on the page.
16. In
the properties of the first extender choose targetcontrolid to be textbox1.
17. In
the properties of the second extender choose targetcontrolid to be textbox2.
18. In
the properties window, choose textbox1 and identifies the newly added options
under the watermark title.
19.
In the CSS style option type watermark
and in the watermark text enter: First Name then Last Name.
20. For
the second textbox type watermark as CSS property and
in the watermark text enter: (000) 00 0000000.
21. Now
your project is ready and you can test it. It is important to note that
watermark is not a validation, it is only additional information provided.