I get an exception when trying to validate an object that inherits
from a base object with attribute validators:

"No public instance field or property named pass1 for type
Implementation.CustomUser "

Code:

Default.aspx
    protected void SaveUserButton_Click(object sender, EventArgs e)
    {
        var u = new CustomUser()
                    {
                        pass1 = pass1.Text,
                        pass2 = pass2.Text
                    };

        var vr = new ValidatorRunner(new CachedValidationRegistry());
        vr.IsValid(u);
    }

CustomUser.cs:
    public class CustomUser : BaseUser
    {
    }

BaseUser.cs
    public class BaseUser
    {
        [ValidateNonEmpty]
        public string pass1 { get; set; }

        [ValidateSameAs("pass1")]
        public string pass2 { get; set; }
    }

Am I doing something wrong?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to