d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Iso Help (data Annotations - Password)
Add Reply New Topic New Poll
Member
Posts: 1,502
Joined: May 20 2009
Gold: 55.00
Sep 7 2013 12:29am
Just curious as to what the syntax is for validating 1 numeric value within a password on a registration model

[Required]
[Display(Name = "Password:")]
[DataType(DataType.Password)]
[StringLength(50, ErrorMessage = "the password must be at least 6 characters long.", MinimumLength = 6)]
public string Password { get; set; }

That's currently what i have which makes sure the password is within 6-50 characters, any help would be much appreciated
Member
Posts: 29,723
Joined: Jun 11 2007
Gold: 279.52
Sep 7 2013 10:57am
look up regular expressions. you cant find a number in a string without them, because well a string is a string, lol.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll