Render ASP.NET TextBox as HTML5 Input type “Number”

ASP.NetProgramming ScriptsWeb DevelopmentFront End Scripts

To render ASP.NET TextBox as HTML5 input type “Number”, set type="number" directly on the textbox.

Let us see an example of ASP.NET TextBox −

<asp:TextBox runat="server" type="number" />

You can also use the following dynamically created the control −

TextBox tb = new TextBox();
tb.Attributes.Add("Type", "number");
Updated on 25-Jun-2020 06:07:18