Search code examples
asp.netmembershipchange-password

Change password error


I want to change a password for a user.

I tried this but it doesn't work:

MembershipUser mu = Membership.GetUser(ddlUsers.SelectedValue, false);
**mu.ChangePassword(mu.ResetPassword(), "password2!");**  

This is my Error: Value can not be null. Parameter name: password answer

Anyone a idea?


Solution

  • In your web.config you probably have a value that requires you to set a security question/answer for a member. You can turn this off with this setting in your membership provider settings section in your web.config:

    requiresQuestionAndAnswer="false"