System.Web.UI.WebControls.ChangePassword.OnChangingPassword Method

Raises the ChangePassword.ChangingPassword event before the user's password is changed by the membership provider.

Syntax

protected virtual void OnChangingPassword (LoginCancelEventArgs e)

Parameters

e
A System.ComponentModel.CancelEventArgs object containing the event data.

Remarks

The ChangePassword.OnChangingPassword(LoginCancelEventArgs) method is called before the membership provider specified in the ChangePassword.MembershipProvider property is called to change the user's password.

Use the ChangePassword.OnChangingPassword(LoginCancelEventArgs) method to perform any processing that is necessary before changing the password, such as checking the new password to make sure it is not in a list of common passwords.

The ChangePassword.OnChangingPassword(LoginCancelEventArgs) method can cancel the ChangePassword.ChangingPassword event by setting the System.ComponentModel.CancelEventArgs.Cancel property of the System.ComponentModel.CancelEventArgs object passed as the e parameter to true.

Raising an event invokes the event handler through a delegate. For more information, see Server Event Handling in ASP.NET Web Pages.

The ChangePassword.OnChangingPassword(LoginCancelEventArgs) method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Requirements

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