html - 为 html5 输入类型 ="date"呈现 asp.TextBox

标签 html asp.net webforms textbox

不知道以前有没有问过,也没找到。

是否可以控制 asp:TextBox 呈现的输入文本的类型?我想将其更改为 <input type="date">

欢迎任何建议或意见,谢谢

最佳答案

.NET Framework 4 有一个更新,允许您指定类型属性

http://support.microsoft.com/kb/2468871 .

请参阅页面下方的功能 3

Feature 3

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" />

关于html - 为 html5 输入类型 ="date"呈现 asp.TextBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2768515/

相关文章:

javascript - 将多个相似的 jQuery 函数转换为一个函数 - 动态

java - [JSoup]如何访问标签内的值

javascript - 使用选择选项下拉更改图像,但对于多个事件?

ASP.NET - Server.HtmlEncode 将哪些字符编码为命名字符实体

javascript窗口重定向不会启动

asp.net - ModelState.IsValid 返回 true,即使所需字符串为 null

javascript - 使用 ECharts 中的 HTML 按钮激活/停用图表线?

javascript - Javascript 参数中的单引号

c# - 在这种情况下编写好的单元测试

ASP.NET MVC 应用程序设置 loginUrl 接受