Click here to Skip to main content
15,891,529 members

1 solution

You only need to decorate the fields with attributes for email for example you could specify the email as follows.

C#
[Required(ErrorMessage = "Please indicate email")]
        [RegularExpression(".+\\@.+\\..+",
        ErrorMessage = "Please indicate valid email")]
        public string Email { get; set; }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900