Email address validation using ASP.NET MVC data type attributes
来源:互联网 发布:实时监测网速软件 编辑:程序博客网 时间:2024/05/17 04:10
http://stackoverflow.com/questions/16712043/email-address-validation-using-asp-net-mvc-data-type-attributes
If you are using .NET Framework 4.5, the solution is to use EmailAddressAttribute
which resides inside System.ComponentModel.DataAnnotations
.
Your code should look similar to this:
[Display(Name = "Email address")] [Required(ErrorMessage = "The email address is required")] [EmailAddress(ErrorMessage = "Invalid Email Address")] public string Email { get; set; }
0 0
- Email address validation using ASP.NET MVC data type attributes
- Email Address Validation
- Selective Validation Using ASP.NET Validation Controls
- How to use HTML-5 data-* attributes in ASP.NET MVC
- Asp.net MVC 4 Attributes特性
- asp.net mvc validation framework -xVal
- asp.net mvc validation framework -xVal
- AsyncFileUpload File Type and File Size Validation using VB.NET
- Business Object Validation Using Attributes in C#
- MVC architecture in ASP.Net using C# and Microsoft Data Access Application block
- Asp Email using CDONTS
- ASP.NET Attributes属性
- MVC architecture in ASP.Net using C#
- Url Rewriting Using ASP.NET MVC Framework
- Using JSONP in ASP.NET MVC
- ASP.NET MVC:也谈实体验证(Entity Validation)
- ASP.NET MVC2 数据模型验证类库:MVC Foolproof Validation
- ASP.NET MVC 3 Validation - 谨慎ValidationMessage的误触发
- 刀锋入骨髓的特点否认色的日粉丝rf
- 2014华为机试西安地区A组试题
- Shell parameter expansion
- kdump初探
- cgroups
- Email address validation using ASP.NET MVC data type attributes
- How do I add placeholder text from the model into a MVC view?
- Enable Password Resetting with Simple Membership in MVC 4
- Working with Roles in ASP.NET MVC 4+
- linux 实时时钟(RTC)驱动
- No Tipping +回溯+物理+贪心
- Display a view from another controller in ASP.NET MVC
- mini2440驱动分析之LCD
- 纯CSS气泡框实现方法探究