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");
raja
Published on 05-Apr-2018 13:19:21
Advertisements