问题描述
不知道之前有没有问过,也没找到.
I don't know if it has been asked before, couldn't find it either.
是否可以控制由 asp:TextBox 呈现的输入文本的类型?我想把它改成
Is it possible to control the type of the input text that is rendered by an asp:TextBox? I would like to change it to <input type="date">
欢迎任何建议或意见,谢谢
any suggestions or comments are welcome, thanks
推荐答案
.NET framework 4 的更新允许您指定类型属性
There is an update for .NET framework 4 which allows you to specify the type attribute
http://support.microsoft.com/kb/2468871.
在页面下方查看功能 3
功能 3
新语法让你定义一个HTML5 的 TextBox 控件兼容的.例如,以下代码定义了一个 TextBox 控件,它是兼容 HTML5:
New syntax lets you define a TextBox control that is HTML5 compatible. For example, the following code defines a TextBox control that is HTML5 compatible:
<asp:TextBox runat="server" type="some-HTML5-type" />
这篇关于为 html5 输入类型=“日期"渲染 asp.TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!