Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# - how to set text in textbox to show hint when textbox is empty?

I am using <asp:TextBox> not HTML textbox and I want to display hint text.

Is there any way to achieve that?

I have tried for making static text and color it gray but not getting how to make it empty when cursor get focus to that textbox.

like image 414
Heena Avatar asked Oct 14 '11 06:10

Heena


Video Answer


2 Answers

<asp:TextBox ID="TextBox1" runat="server" placeholder="Hint Text"></asp:TextBox>
like image 109
Mukund Avatar answered Sep 23 '22 02:09

Mukund


Use a ASP.NET WaterMark TextBox

It is in Ajax Toolkit

like image 25
Muhammad Hasan Khan Avatar answered Sep 24 '22 02:09

Muhammad Hasan Khan