MembershipService.ChangePassword doesn’t change password issue. I have no clue why…
var userUsers = from n in db.aspnet_Users where n.UserId == id select n;
string userName = userUsers.Single<aspnet_Users>().UserName;
MembershipUser user = Membership.GetUser(userName, false);
if (user != null)
{
string generatedPassword = user.ResetPassword();
if (MembershipService.ChangePassword(userName, generatedPassword, model.NewPassword))
{
// So it doesn't change the password
Check this out in the documentation:
Before changing a password,
ChangePasswordcalls the provider’s overridableOnValidatingPasswordmethod to validate the new password. It then changes the password or cancels the action based on the outcome of the call.Following a successful password change,
ChangePasswordupdates the user’sLastPasswordChangedDate.This helped me once when I had the exact same problem. The password was not valid so the method never actually changed it. I changed some password configuration in the
web.configfile and then it finally worked.Check this lines of your web.config, this might be the problem:
Hope it helps!