I was trying to require a text input field in a form, which implies that there needs to be something in the form. However, adding a [Required] tag to my model w
I'd implement a new validation attribute like this and apply it to my model.
public class RequiredNotEmptyAttribute : RequiredAttribute
{
public override bool IsValid(object value)
{
if(value is string) return !String.IsNullOrEmpty((string)value);
return base.IsValid(value);
}
}
This will only work on the server side (client side will still only check for null).