【问题标题】:Numeric updown TextBox not displaying buttons in IE [duplicate]数字updown TextBox不在IE中显示按钮[重复]
【发布时间】:2025-11-29 23:10:01
【问题描述】:

我有一个 HTML input 控件

<input id="textBox1" class="form-control" runat="server"/>

我添加了以下 C# 代码以使其成为数字上下控件:

textBox1.Attributes["type"] = "number";
textBox1.Attributes["min"] = "0";
textBox1.Attributes["max"] = "50";
textBox1.Attributes["step"] = "1";

这在 Chrome 中运行良好,但在 Internet Explorer 中不显示 updown 按钮。

我应该怎么做才能在 IE 中也显示按钮?

我知道here 有人问过类似的问题,但我认为在 Sachin Gupta 的回答中建议here 在代码中添加属性可以克服这个问题。

【问题讨论】:

    标签: c# asp.net webforms numericupdown


    【解决方案1】:

    https://caniuse.com/#feat=input-number 附加到 IE 版本的注释是:

    UI 小部件不包括递增/递减按钮。

    【讨论】:

      最近更新 更多