Export (0) Print
Expand All

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
<asp:CreateUserWizard OnCreatingUser="LoginCancelEventHandler" />

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="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>CreateUserWizard.CreatingUser sample</title>
    <form id="form1" runat="server">
      <asp:createuserwizard id="Createuserwizard1" runat="server" 
        oncreatinguser="Createuserwizard1_CreatingUser" >

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft