MembershipCreateStatus Enumeration

Describes the result of a CreateUser operation.

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

public enum class MembershipCreateStatus
public enum MembershipCreateStatus
public enum MembershipCreateStatus

 Member nameDescription
DuplicateEmailThe e-mail address already exists in the database for the application. 
DuplicateProviderUserKeyThe provider user key already exists in the database for the application. 
DuplicateUserNameThe user name already exists in the database for the application. 
InvalidAnswerThe password answer is not formatted correctly. 
InvalidEmailThe e-mail address is not formatted correctly. 
InvalidPasswordThe password is not formatted correctly. 
InvalidProviderUserKeyThe provider user key is of an invalid type or format. 
InvalidQuestionThe password question is not formatted correctly. 
InvalidUserNameThe user name was not found in the database. 
ProviderErrorThe provider returned an error that is not described by other MembershipCreateStatus enumeration values. 
SuccessThe user was successfully created. 
UserRejectedThe user was not created, for a reason defined by the provider. 

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.

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.

No code example is currently available or this language may not be supported.

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

ADD
Show: