StatusCode Property
Collapse the table of content
Expand the table of content

MembershipCreateUserException.StatusCode Property


Gets a description of the reason for the exception.

Namespace:   System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

public MembershipCreateStatus StatusCode { get; }

Property Value

Type: System.Web.Security.MembershipCreateStatus

A MembershipCreateStatus enumeration value that describes the reason for the exception.

The StatusCode property enables you to determine why the MembershipCreateUserException was thrown and respond accordingly.

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, the code catches the MembershipCreateUserException and displays the message specified in the StatusCode property.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft