Validate for Empty String with different error message!

Sep 19, 2008 at 10:48 AM
Commonly validators do not validate empty strings and that is why we usually use RequiredFieldValidator for such validation.
I suggest to validate empty string in with different error message other than the one specified for uniqueness validation. Is that make sense?!

Coordinator
Sep 19, 2008 at 5:00 PM
I think the empty string validation is a product of it validating on delete/backspace when you clear the field, more than an intentional validation of the empty string.

Would it make sense for us to also make the field required (and/or a minimum length), or should we leave that alone and expect that a RequiredFieldValidator be used if that functionality is desired?
Sep 19, 2008 at 6:29 PM
I was thinking about that! the common usage is that no validators validate empty string except RequiredFieldValidators. If this control support validation for Empty string then this control break that common usage! Is that something good or bad I don't know.
But I really wished most of the time that there were be an option to validate empty string for most of the validators. Just like CustomValidator, it has an option to validate empty string.
So from my point of view, I think validating Empty String with different error message would be acceptable.
Coordinator
Sep 19, 2008 at 8:44 PM
I think I tend to agree.

Since we're already tracking a minimum length, we might as well validate for that condition.  It's not as if a developer will ever want the user to submit an empty username.

Anyone disagree with us handling minimum length validation?
Coordinator
Sep 23, 2008 at 12:18 AM
Assuming we're in agreement about validating for minimum length, what should be property name be for its validation message? 

MinimumLengthErrorMessage?  That's kind of long.

UsernameLengthErrorMessage?  Ugh, getting longer...

Any ideas that will be discoverable, but aren't ridiculously long?
Jul 14, 2009 at 7:55 AM

Thanks for the control..

Did you able to add the Empty string validation??