Improved error message for username regex on register form
This commit is contained in:
parent
a2a9a6e21d
commit
55a7d71c7f
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ public class RegisterForm
|
||||||
[Required(ErrorMessage = "You need to provide an username")]
|
[Required(ErrorMessage = "You need to provide an username")]
|
||||||
[MinLength(7, ErrorMessage = "The username is too short")]
|
[MinLength(7, ErrorMessage = "The username is too short")]
|
||||||
[MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")]
|
[MaxLength(20, ErrorMessage = "The username cannot be longer than 20 characters")]
|
||||||
[RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers")]
|
[RegularExpression("^[a-z][a-z0-9]*$", ErrorMessage = "Usernames can only contain lowercase characters and numbers and should not start with a number")]
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "You need to provide an email address")]
|
[Required(ErrorMessage = "You need to provide an email address")]
|
||||||
|
|
Loading…
Reference in a new issue