Validator validates wrong

Topics: Validation Application Block
Sep 26, 2007 at 9:13 PM
How come it always displays message: "OK"

protected void Page_Load(object sender, EventArgs e)
{
SolutionUser user = new SolutionUser("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
Validator validator = ValidationFactory.CreateValidator<SolutionUser>();
ValidationResults result = validator.Validate(user);

if (!result.IsValid)
Response.Write("Not OK");
else
Response.Write("OK");
}

public class SolutionUser
{
StringLengthValidator(5)
private string _UserGuid;
public string UserGuid
{
get { return _UserGuid; }
set { _UserGuid = value; }
}

public SolutionUser(string userGuid)
{
UserGuid = userGuid;
}
}
Sep 28, 2007 at 3:50 PM
Answered elsewhere.
Please avoid multiple posting.

Thanks,
Fernando