ValidatePasswordEventArgs.Password Property
Gets the password for the current create-user, change-password, or reset-password action.
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
Property Value
Type: System.StringThe password for the current create-user, change-password, or reset-password action.
The ValidatingPassword event is raised when the CreateUser, ChangePassword, or ResetPassword method of a membership provider is called.
You can handle the ValidatingPassword event to validate password formats and values for membership users.
You can cancel the current CreateUser, ChangePassword, or ResetPassword action by setting the Cancel property to true during the ValidatingPassword event.
If you cancel the current action by setting the Cancel property to true, you can set the FailureInformation property to an exception that describes the reason for the password-validation failure. The calling method will throw the exception that the FailureInformation property is set to. If the FailureInformation property is null, the caller will throw a generic password-validation failure exception.
The following code example shows a ValidatingPassword event that validates the format of the password for the user and cancels the action if the password does not match the required format.
Available since 2.0