0 out of 2 rated this helpful - Rate this topic

CreateUserWizard.CreatingUser Event

Note: This event is new in the .NET Framework version 2.0.

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)

JScript supports the use of events, but not the declaration of new ones.

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#"%>

<script runat="server">
  
  void Createuserwizard1_CreatingUser (object sender, LoginCancelEventArgs e)
  {
    Createuserwizard1.UserName.ToLower();
  }
  
</script>

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

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

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

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ