Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RegisterViewModel
- {
- [Required]
- [StringLength(20, ErrorMessage = "The {0} must be between {2} and {1} characters long.", MinimumLength = 5)]
- [RegularExpression("^([a-zA-Z0-9]{5,20})$", ErrorMessage = "The {0} must contain only alphanumeric characters")]
- [Display(Name = "Username")]
- public string RegisterUsername { get; set; }
- [Required]
- [Display(Name = "Email")]
- public string RegisterEmail { get; set; }
- [Required]
- [StringLength(20, ErrorMessage = "The {0} must be between {2} and {1} characters long.", MinimumLength = 8)]
- [DataType(DataType.Password)]
- [Display(Name = "Password")]
- public string RegisterPassword { get; set; }
- [DataType(DataType.Password)]
- [Display(Name = "Confirm password")]
- [Compare("RegisterPassword", ErrorMessage = "The password and confirmation password do not match.")]
- public string ConfirmPassword { get; set; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement