System.Web.UI.WebControls.CreateUserWizard.OnCreatingUser Method

Raises the CreateUserWizard.CreatingUser event prior to calling the membership provider to create the new user account.

Syntax

protected virtual void OnCreatingUser (LoginCancelEventArgs e)

Parameters

e
A System.Web.UI.WebControls.LoginCancelEventArgs containing the event data.

Remarks

Use the CreateUserWizard.OnCreatingUser(LoginCancelEventArgs) method to do any processing required before sending the new user information to the System.Web.Security.MembershipProvider.CreateUser(string, string, string, string, string, bool, object, System.Web.Security.MembershipCreateStatus@) method of the membership provider specified in the CreateUserWizard.MembershipProvider property. For example, you might set the user name field to all lowercase letters, or compare the e-mail address to a list of restricted addresses before allowing creation of the user account.

If you need to cancel the request to create the new user account, set the LoginCancelEventArgs.Cancel property of the System.Web.UI.WebControls.LoginCancelEventArgs object passed as the e parameter to true.

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The CreateUserWizard.OnCreatingUser(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