Shankar
Shankar

Reputation: 1656

ASP.NET TextBox control with label text in the background

I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it blank and tabs to the next textbox, then these words appear again. This will eliminate the need for having separate labels in front of the text boxes. I would appreciate if someone can share their expertise for doing this.

Upvotes: 5

Views: 3498

Answers (2)

phloopy
phloopy

Reputation: 5593

Use the TextBox Watermark Extender that's in Microsoft's AJAX Toolkit.

Upvotes: 11

mattlant
mattlant

Reputation: 15451

Google "ASP.NET Watermark textbox". Theres a ton of implemnentations

Upvotes: 1

Related Questions