简体   繁体   中英

asp:textbox force numeric keypad on Internet Explorer Metro

On a touchscreen PC, when using the Metro Internet explorer,

Is there any way to force the numeric keypad to open first when the focus is put on an asp:Testbox control ?

<asp:TextBox ID="txtBadge" runat="server" MaxLength="9" style="width: 100px; height: 30px; font-size: 16pt;" TabIndex="1"></asp:TextBox>

Its a number only textbox and having the normal keyboard pop up when its selected is annoying for users as it slows them down.

So instead of this : 初始触摸键盘

Id like this to show: 数字键和符号键盘

Assuming IE10/Metro follows the standard approach, you need an HTML5 <input type="number"... in your output. If you're using .NET 4.5, you can just set TextMode="Number" on your TextBox :

<asp:TextBox ID="txtBadge" runat="server" TextMode="Number" ...

If you're using .NET 4.0, there's an update which will let you specify the type attribute:

<asp:TextBox ID="txtBadge" runat="server" type="number" ...

If you're using .NET 3.5 or earlier, the HTML5 input types are not supported by the built-in controls. You'll need to write a custom control to support them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM