Render asp.TextBox for html5 input type=quot;datequot;(为 html5 输入类型=“日期渲染 asp.TextBox)
问题描述
不知道之前有没有问过,也没找到.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为 html5 输入类型=“日期"渲染 asp.TextBox


基础教程推荐
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01