System.Web.Security.MembershipValidatePasswordEventHandler Delegate

Represents the method that will handle the MembershipProvider.ValidatingPassword event of the System.Web.Security.MembershipProvider class.

Syntax

public delegate void MembershipValidatePasswordEventHandler (object sender, ValidatePasswordEventArgs e)

Parameters

sender
Documentation for this section has not yet been entered.
e
Documentation for this section has not yet been entered.

Remarks

The System.Web.Security.MembershipValidatePasswordEventHandler delegate is defined for the MembershipProvider.ValidatingPassword event for a membership provider. The MembershipProvider.ValidatingPassword event is raised when the MembershipProvider.CreateUser(string, string, string, string, string, bool, object, MembershipCreateStatus@) method, the MembershipProvider.ChangePassword(string, string, string) method, or the MembershipProvider.ResetPassword(string, string) method of a membership provider is called.

You can use the MembershipProvider.ValidatingPassword event to validate password formats and values for membership users.

You can cancel the current MembershipProvider.CreateUser(string, string, string, string, string, bool, object, MembershipCreateStatus@), MembershipProvider.ChangePassword(string, string, string), or MembershipProvider.ResetPassword(string, string) action by setting the ValidatePasswordEventArgs.Cancel property of the supplied System.Web.Security.ValidatePasswordEventArgs to true during the MembershipProvider.ValidatingPassword event.

If you cancel the current action by setting the ValidatePasswordEventArgs.Cancel property to true, you can set the ValidatePasswordEventArgs.FailureInformation property of the supplied System.Web.Security.ValidatePasswordEventArgs to an exception that describes the reason for the password-validation failure. The calling method will throw the exception that the ValidatePasswordEventArgs.FailureInformation property is set to. If the ValidatePasswordEventArgs.FailureInformation property is null, the caller will throw a generic password-validation failure exception.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0