if (!IsPostBack) { txtemail.Attributes.Add("value", "Email Id"); txtpassword.Attributes.Add("value", "Password"); TextBox1.Attributes.Add("value", "Enter Email Id"); txtemail.Attributes.Add("onblur", "javascript:if(this.value==''){this.value='Email Id'}"); txtemail.Attributes.Add("onFocus", "javascript:if(this.value=='Email Id'){this.value=''}"); TextBox1.Attributes.Add("onblur", "javascript:if(this.value==''){this.value='Enter Email Id'}"); TextBox1.Attributes.Add("onFocus", "javascript:if(this.value=='Enter Email Id'){this.value=''}"); txtpassword.Attributes.Add("onblur", "javascript:if(this.value==''){this.value='Password'}"); txtpassword.Attributes.Add("onFocus", "javascript:if(this.value=='Password'){this.value=''}"); }
<asp:TextBox ID="TextBox1" runat="server" style="text-align: left" Width="151px" Font-Names="Arial" Font-Size="Small" ForeColor="#333333" ToolTip="please enter your email ID" Font-Bold="True" TabIndex="1"></asp:TextBox>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)