如何使用服务器端.NET HTML5电子邮件输入类型 [英] How can I use HTML5 email input type with server-side .NET
问题描述
据我了解,在<输入类型=电子邮件>在HTML5
元素将呈现为在不支持标签浏览器的一个简单的文本字段。在其他浏览器就会正确地呈现,就像在iPhone上就会弹出电子邮件键盘布局。
我想用这个项目中,但我的输入字段是< ASP:文本框>
控制。如何使用HTML5元素,但仍然访问其数据的服务器端像我其余字段?
有是.NET Framework 4的更新,它允许您指定type属性。
http://support.microsoft.com/kb/2468871 。
请参阅功能3
一路下滑的页面
特点3
新语法允许您定义
TextBox控件是HTML5
兼容。例如,下面的
code定义了一个TextBox控件是
HTML5兼容的:< ASP:文本框=服务器TYPE =一些-HTML5型/>
块引用>As I understand it, the
<input type=email>
element in HTML5 will render as a simple text field in browsers that do not support the tag. On other browsers it will render properly, like on the iPhone it will bring up the e-mail keyboard layout.I’d like to use this in a project but my input fields are
<asp:TextBox>
controls. How can I use the HTML5 element but still access its data server-side like the rest of my fields?解决方案There is an update for .NET framework 4 which allows you to specify the type attribute
http://support.microsoft.com/kb/2468871.
See
feature 3
way down the pageFeature 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" />
这篇关于如何使用服务器端.NET HTML5电子邮件输入类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!