Edit

Share via


ChangePassword.OnChangingPassword(LoginCancelEventArgs) Method

Definition

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

protected:
 virtual void OnChangingPassword(System::Web::UI::WebControls::LoginCancelEventArgs ^ e);
protected virtual void OnChangingPassword(System.Web.UI.WebControls.LoginCancelEventArgs e);
abstract member OnChangingPassword : System.Web.UI.WebControls.LoginCancelEventArgs -> unit
override this.OnChangingPassword : System.Web.UI.WebControls.LoginCancelEventArgs -> unit
Protected Overridable Sub OnChangingPassword (e As LoginCancelEventArgs)

Parameters

e
LoginCancelEventArgs

A CancelEventArgs object containing the event data.

Remarks

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

Use the OnChangingPassword 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 OnChangingPassword method can cancel the ChangingPassword event by setting the Cancel property of the 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 Forms Pages.

The OnChangingPassword 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.

Notes to Inheritors

When overriding the OnChangingPassword(LoginCancelEventArgs) method in a derived class, be sure to call the OnChangingPassword(LoginCancelEventArgs) method for the base class so that registered delegates receive the event.

Applies to

See also