为 html5 输入类型=“日期"渲染 asp.TextBox [英] Render asp.TextBox for html5 input type="date"

查看:24
本文介绍了为 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆