MembershipCreateUserException::StatusCode Property
.NET Framework (current version)
Gets a description of the reason for the exception.
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
Property Value
Type: System.Web.Security::MembershipCreateStatusA 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
Available since 2.0
Show: