Sunday, July 21, 2019

Class for User Register - MVC

public class UserRegisterModel
    {
        [DisplayName("User Name")]
        [Required(ErrorMessage="Name can not be blank")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Password can not be blank")]
        [StringLength(6,ErrorMessage="Password should be equal or less than 6 character")]
        public string Password { get; set; }

        [Required(ErrorMessage = "Email can not be blank")]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*",ErrorMessage="Email is not Valid")]
        public string Email { get; set; }
    }