Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
[Required] [DataType(DataType.EmailAddress)] [Display(Name = "Email address")] [RegularExpression(@"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$",ErrorMessage="Invalid email address")] public string Email { get; set; }
No comments:
Post a Comment