I tried creating a new user using CreateUser method. but when I click create user button I get this weird error : "The password-answer supplied is invalid".
I already tried putting a strong password (123$567) or a normal password(1234). I doubt it has anything to do with the password strength because that would throw a different exception.
Here is my code:
Membership.CreateUser(username, password);
Can anyone tell me why is this happening?
In your web.config you probably have the setting
<system.web>
<membership>
<providers>
<add bla="bla" requiresQuestionAndAnswer="true" ...
Could this be the problem?
Using @spender's tip (+1) I found the below worked for me by explicitly stating requiresQuestionAndAnswer="false" in the web.config (I had to add the attribute). I then found I could just use Membership.CreateUser(userName, password, email); to create my user.
<system.web>
<membership>
<providers>
<add bla="bla" requiresQuestionAndAnswer="false"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With