The following 2 event properties are added to the foreground text box:
Onfocus= "javascript:if (this.value== ' hint text ') {this.value= '}"
Onblur= "Javascript:if (this.value==") {this.value= ' hint text '} '
-----------------------------------Example-----------------------------------------
<asp:textbox id= "txtname" runat= "server" text= "Please enter user name"
Onfocus= "javascript:if (this.value== ' Please enter user name ') {this.value= '}"
Onblur= "Javascript:if (this.value==") {this.value= ' Please enter user name '} ' >
</asp:TextBox>
<asp:textbox id= "txtpwd" runat= "server" text= "Please enter password"
Onfocus= "javascript:if (this.value== ' Please enter password ') {this.value= '}"
Onblur= "Javascript:if (this.value==") {this.value= ' Please enter password '} ' >
</asp:TextBox>
Original Blog Address: http://www.cnblogs.com/carekee/articles/2093593.html
ASP. NET TextBox empty default prompt text when mouse clicks [Go]