如何使用服务器端.NET HTML5电子邮件输入类型 [英] How can I use HTML5 email input type with server-side .NET

查看:223
本文介绍了如何使用服务器端.NET HTML5电子邮件输入类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,在<输入类型=电子邮件>在HTML5 元素将呈现为在不支持标签浏览器的一个简单的文本字段。在其他浏览器就会正确地呈现,就像在iPhone上就会弹出电子邮件键盘布局。

我想用这个项目中,但我的输入字段是< ASP:文本框> 控制。如何使用HTML5元素,但仍然访问其数据的服务器端像我其余字​​段?


解决方案

有是.NET Framework 4的更新,它允许您指定type属性。

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

请参阅功能3 一路下滑的页面


  

特点3


  
  

新语法允许您定义
  TextBox控件是HTML5
  兼容。例如,下面的
  code定义了一个TextBox控件是
  HTML5兼容的:

 < ASP:文本框=服务器TYPE =一些-HT​​ML5型/>


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 page

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

这篇关于如何使用服务器端.NET HTML5电子邮件输入类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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