-
MembershipCreateStatus - An unknown error occurred
How can i determine what the error is when none of the enumeration errors have been selected. this is my switch statement
switch (localStatus)
{
case MembershipCreateStatus.Success:
lblCreateUserStatus.ForeColor = System.Drawing.Color.Green;
lblCreateUserStatus.Text = "The user account was successfully created!";
//have to create user in CMM customer object also
break;
case MembershipCreateStatus.DuplicateUserName:
lblCreateUserStatus.Text = "There already exists a user with this username.";
break;
case MembershipCreateStatus.DuplicateEmail:
lblCreateUserStatus.Text = "There already exists a user with this email address.";
break;
case MembershipCreateStatus.InvalidEmail:
lblCreateUserStatus.Text = "There email address you provided in invalid.";
break;
case MembershipCreateStatus.InvalidAnswer:
lblCreateUserStatus.Text = "There security answer was invalid.";
break;
case MembershipCreateStatus.InvalidPassword:
lblCreateUserStatus.Text = "The password you provided is invalid. It must be seven characters long and have at least one non-alphanumeric character.";
break;
case MembershipCreateStatus.ProviderError:
lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
lblCreateUserStatus.Text = "There was a provider error; the user account was NOT created.";
break;
case MembershipCreateStatus.InvalidProviderUserKey:
lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
lblCreateUserStatus.Text = "There was a provider User Key error; the user account was NOT created.";
break;
case MembershipCreateStatus.InvalidUserName:
lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
lblCreateUserStatus.Text = "The username is invalid.";
break;
default:
lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
lblCreateUserStatus.Text = "There was an unknown error; the user account was NOT created.";
break;
}
the default is always chosen is there a way to debug what error is really happening?
-
I would wrap the call to CreateUser in a try...catch block and see what the exception says.
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Similar Threads
-
By dzirkelb in forum AJAX
Replies: 1
Last Post: 05-03-2007, 09:16 AM
-
By iam13013 in forum .NET
Replies: 1
Last Post: 03-26-2007, 08:45 AM
-
By Jimmy Dohee in forum Enterprise
Replies: 0
Last Post: 06-21-2002, 07:00 PM
-
By Rich Smith in forum Enterprise
Replies: 0
Last Post: 02-26-2001, 07:51 PM
-
By touri in forum VB Classic
Replies: 0
Last Post: 05-18-2000, 09:01 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks