Placeholder/Example text in textbox for user Placeholder/Example text in textbox for user asp.net asp.net

Placeholder/Example text in textbox for user


I believe you want a placeholder attribute:

<asp:TextBox ID="placeholderTextBox" runat="server" placeholder="mm/dd/yyyy"></asp:TextBox>


but placeholder doenst work for many IE browser because placeholder is html5 thing.

try to use modernizr framework. it works for all browsers including all IE

here is a sample code for you.

if(modernizr.input.placeholder) {   //insert placeholder polyfill script here. }


Visual Studio maybe not knowing the attribute. Attributes which are not registered with ASP.net are passed through and rendered as is.

<asp:TextBox ID="TextBox1" runat="server"  Width="187px" placeholder="mm/dd/yyyy"></asp:TextBox>