Print Page | Close Window

Password Boxes in Registration Form

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2600
Printed Date: 26-Jan-2026 at 11:00am


Topic: Password Boxes in Registration Form
Posted By: gregweb
Subject: Password Boxes in Registration Form
Date Posted: 31-Mar-2011 at 4:41pm
I am using the DevForce Biz App template to create a new project.
 
I enter a connection string to a ASPNETDB.
 
I then run the app, click the register button and try to register.
 
If the two passwords match the first time, all is fine.  However, if they do not match, the top password box stays red even when the two passwords do match.  The second password box does change back to normal status.  The only way to resolve is to close the registration form and get it right the first time.  I looked at the code that does the verification, but I couldn't resolve what the issue is.
 
Greg
 
 



Replies:
Posted By: robertg
Date Posted: 01-Apr-2011 at 9:47am
Greg,

I see what you're talking about, and will look into it. The template may need some additional code in order to clear the error condition from both boxes. I'll update you when I've got it resolved.

--Robert


Posted By: gregweb
Date Posted: 01-Apr-2011 at 12:43pm
Thanks Robert.
 
Greg


Posted By: robertg
Date Posted: 04-Apr-2011 at 3:13pm
Greg,

The template lacks the logic to clear errors when there are two triggers for a given validation test. You should be able to resolve this by making the two following changes to your VerifiableObject class:

Add this method:

        public void RemoveError(VerifierResult result)
        {
            ValidationErrors.Remove(result);
            GetPropertyNames(result).ForEach(OnErrorsChanged);
        }

Replace ClearErrors(string propertyName) with:

        private bool ClearErrors(string propertyName)
        {
            var remove = ValidationErrors.Where(vr => GetPropertyNames(vr).Contains(propertyName)).ToList();
            remove.ForEach(r => RemoveError(r));
            return remove.Count > 0;
        }


Posted By: gregweb
Date Posted: 06-Apr-2011 at 12:12pm
Great thanks, that works.
 
Greg



Print Page | Close Window