RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomLoginFormAdapter.OnValidateUserName Event

Occurs when the login form adapter must validate the name that the user supplied.

Pascal
property OnValidateUserName: TValidateAdapterFieldEvent;
C++
__property TValidateAdapterFieldEvent OnValidateUserName;

Write an OnValidateUserName event handler to validate the name that the user supplies when logging in. This event occurs after the OnValidatePassword event and before the OnLogin event. 

If the event handler sets the Handled parameter to true, the login form adapter assumes that the user name (which is the value of the Value parameter and of the UserName property) is valid. In this case, the adapter checks whether the WebSnap application includes a TWebUserList component, and if so, checks the user name against the password. If the event handler sets the Handled parameter to false, the adapter validates the user name by checking whether it is nonempty. In this case, the adapter raises an EAdapterFieldException exception if the value of UserName is an empty string. If the OnValidateUserName event handler finds the user name to be invalid, it should raise an exception. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!