views:

237

answers:

1

There is an issue reported here http://stackoverflow.com/questions/481416/asp-net-membership-issues-with-registration which summarizes a situation I am experiencing. I'm not sure I understand the claimed solution.

Simply put, after invoking this line:

MembershipUser user = Membership.CreateUser(username, password, email, question, answer, true, out status);

I run into a situation where

status != MembershipCreateStatus.Success || user == null

yet entries are added to the tables: aspnet Users and aspnet Membership.

Here is what I have in my web.config

 passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"

Can someone enlighten me on how to reproduce this issue so that I can fix the related issue in my code?

+1  A: 

If your MembershipCreateStatus.Success is != to success then have you checked the other enumeration values to see if one of them give you more of a clue:

DuplicateUserName, DuplicateEmail, InvalidPassword, InvalidEmail, InvalidAnswer, InvalidQuestion, InvalidUserName, ProviderError, UserRejected

klabranche
I would expect that all of these would not create anything new in the database (but I have not tested these individually)
Jason Kealey
I agree but it will be interesting and perhaps enlightening to see what they return.
klabranche