CreatingUser Event
Collapse the table of content
Expand the table of content

CreateUserWizard.CreatingUser Event

Occurs before the membership provider is called to create the new Web site user account.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public event LoginCancelEventHandler CreatingUser
/** @event */
public void add_CreatingUser (LoginCancelEventHandler value)

/** @event */
public void remove_CreatingUser (LoginCancelEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

The CreatingUser event is raised prior to calling the CreateUser method on the membership provider specified in the MembershipProvider property.

Use the CreatingUser event to establish defaults or modify the information entered by the user before passing the information to the membership provider.

For more information about handling events, see Consuming Events.

The following code example uses the CreatingUser event to make the UserName property all lowercase before submitting it to the membership provider specified in the MembershipProvider property.

<%@ page language="C#"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<script runat="server">
  void Createuserwizard1_CreatingUser (object sender, LoginCancelEventArgs e)

<html xmlns="" >
<head id="Head1" runat="server">
    <title>CreateUserWizard.CreatingUser sample</title>
    <form id="form1" runat="server">
      <asp:createuserwizard id="Createuserwizard1" runat="server" 
        oncreatinguser="Createuserwizard1_CreatingUser" >

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2016 Microsoft