I have an ASP.NET 3.5
application and I'd like to add the type="email"
according to HTML5
standards but if I add the type on the ASP:TextBox
control I get the below output:
<input name="ctl00$content$txtEmailAddress" type="text" type="email" value=""
id="ctl00_content_txtEmailAddress" class="input-block-level" required="required"/>
How can I replace the type attribute from "text" to "email"?
If you using .Net 3.5 then no matter what type you have specified with <asp:TextBox>
, it will always render with <input type="text" />
. So in that case you can use simple html input with type="email"
<input type="email" />
For 4.5 version you can use TextMode="Email"
<asp:TextBox ID="txtmyBox" runat="server" TextMode="Email"></asp:TextBox>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With