hash - ASP.NET MVC DataAnnotations StringLength On Password ModelState.IsValid Fails When Hashed -


first question is, using stringlength, possible specify minimum length? more importantly, have password.

private string password; [required] [datatype(datatype.password)] [stringlength(15, minimumlength = 6)] public string password { { return password; } set { hashpassword(value); } } 

what want when user enters password can enter minimum of 6 , maximum of 15 characters password. issue lies in controller because modelstate.isvalid fails due hashing generating huge string exceeding 15 characters. how can around this?

i recommend doing hashing elsewhere (e.g. in controller) instead of doing in set accessor of property.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -