views:

277

answers:

1

Because I'm not using .net 4 I can't use StringLength.MinimumLength property. What is alternative? I suppose I should write regular expression:

[Required]
[RegularExpression("", ErrorMessage = "Minimum 3 characters")]
public string Password { get; set; }

Thanks,
Ile

A: 

http://www.tsjensen.com/blog/CommentView,guid,904052d4-8ee0-47b5-bacb-eb1788137233.aspx

Raj Kaimal
Thanks. The regular expression will just do the work. I don't understand why did the author of the blog decide to use the second solution which is requiring a lot of code comparing to one line of regular expression :) Clunky or not clunky it's one line of code :)
ile