Working with TextBox Watermark Extender
page 3 of 5
by Nidal Arabi
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 28354/ 27

Creating your Textbox watermark sample

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.


View Entire Article

User Comments

Title: c   
Name: c
Date: 2012-12-03 7:44:07 AM
Comment:
c
Title: Textbox Watermark is not working   
Name: prabhu
Date: 2012-06-18 2:22:20 AM
Comment:
Contact form 7 wordpress watermark is not working in mozilla firefox.In other browser work properly

Plz Give Me Answer what will problem about this
Title: Textbox Watermark is not working   
Name: Dheeraj
Date: 2011-06-22 2:31:10 AM
Comment:
I don't know why But Textbox Watermark is not working.
Title: hai   
Name: shankar
Date: 2011-02-24 8:51:25 PM
Comment:
hai send me more details. the link for ajax textboxwatermark control. my mailid shankar8910@yahoo.com
Title: Nice Article   
Name: Nike
Date: 2010-03-20 7:49:35 AM
Comment:
This is not working in Mozilla.Please check
http://techdotnets.blogspot.com/
Title: hai   
Name: Arun Krishnan.S
Date: 2009-03-20 1:13:48 AM
Comment:
hai send more details






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-13 10:28:49 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search