MembershipCreateStatus Enumeration
Describes the result of a CreateUser operation.
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
| Member name | Description | |
|---|---|---|
| Success | The user was successfully created. | |
| InvalidUserName | The user name was not found in the database. | |
| InvalidPassword | The password is not formatted correctly. | |
| InvalidQuestion | The password question is not formatted correctly. | |
| InvalidAnswer | The password answer is not formatted correctly. | |
| InvalidEmail | The e-mail address is not formatted correctly. | |
| DuplicateUserName | The user name already exists in the database for the application. | |
| DuplicateEmail | The e-mail address already exists in the database for the application. | |
| UserRejected | The user was not created, for a reason defined by the provider. | |
| InvalidProviderUserKey | The provider user key is of an invalid type or format. | |
| DuplicateProviderUserKey | The provider user key already exists in the database for the application. | |
| ProviderError | The provider returned an error that is not described by other MembershipCreateStatus enumeration values. |
The MembershipCreateStatus enumeration indicates the success or failure of an attempt to create a new user. If the CreateUser operation fails, the MembershipCreateStatus enumeration describes the cause of the failure.
Note |
|---|
If you are not familiar with the membership features of ASP.NET, see Introduction to Membership before continuing. For a list of other topics related to membership, see Managing Users by Using Membership. |
If you use a CreateUser method overload that does not specify an output parameter of type MembershipCreateStatus, an unsuccessful attempt to create a new user throws a MembershipCreateUserException with the StatusCode property set to one of the MembershipCreateStatus enumeration values.
The following code example creates a new user for an ASP.NET application configured to use forms authentication and ASP.NET membership. If the user is not created successfully, a message is displayed to the user. If the user is created successfully, the user is redirected to the login page for the application. This code example uses the MembershipCreateStatus enumeration to determine the message displayed to the user in the event of a failure.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note