Raises the CreateUserWizard.CreatingUser event prior to calling the membership provider to create the new user account.
- e
- A System.Web.UI.WebControls.LoginCancelEventArgs containing the event data.
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.