When an ASP.NET TextBox renders it produces:
However I need it to render as a HTML5 number type instead, like
Override the base textbox control
public class HTML5TextBox : TextBox
{
.....
protected override void Render(HtmlTextWriter writer)
{
//Sth like the code below, you need do some research though
writer.AddAttribute(HtmlTextWriterAttribute.Type,"Number");
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID + "_displayTXT");
writer.AddAttribute(HtmlTextWriterAttribute.Name,this.UniqueID + "t1");
writer.AddAttribute(HtmlTextWriterAttribute.Value,base.Text);
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
}
....
}
Or you can check the one I just found at http://www.codeproject.com/Articles/68834/Enhanced-Textbox-Control