Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8202179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:05:11+00:00 2026-06-07T07:05:11+00:00

MembershipService.ChangePassword doesn’t change password issue. I have no clue why… var userUsers = from

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:05:13+00:00Added an answer on June 7, 2026 at 7:05 am

    Check this out in the documentation:

    ChangePassword returns true if the password was updated successfully.
    Otherwise, it returns false.

    Before changing a password, ChangePassword calls the provider’s overridable OnValidatingPassword method to validate the new password. It then changes the password or cancels the action based on the outcome of the call.

    If the user name, password, new password, or password answer is not
    valid, ChangePassword does not throw an exception; it simply returns
    false.

    Following a successful password change, ChangePassword updates the user’s LastPasswordChangedDate.

    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.config file and then it finally worked.

    Check this lines of your web.config, this might be the problem:

    <membership defaultProvider="Demo_MemberShipProvider">
        <providers>
           <add name="Demo_MemberShipProvider"
                type="System.Web.Security.SqlMembershipProvider"
                connectionStringName="cnn"
                enablePasswordRetrieval="false"
                **enablePasswordReset="true"**
                **requiresQuestionAndAnswer="true"**
                applicationName="/"
                requiresUniqueEmail="false"
                passwordFormat="Hashed"
                maxInvalidPasswordAttempts="5"
                **minRequiredPasswordLength="5"**
                **minRequiredNonalphanumericCharacters="0"**
               passwordAttemptWindow="10" passwordStrengthRegularExpression="">
        </providers>
    </membership>
    

    Hope it helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the regular aspnet_Users table I have created two sub-tables with one to one
Let's say we have a function that changes a password for a user in
I'm trying to test/spec the following action method public virtual ActionResult ChangePassword(ChangePasswordModel model) {
I have a function that updates a user in the asp.net membership provider. <AcceptVerbs(HttpVerbs.Post)>
I have to implement Your Account is Locked! message for the SqlMembershipProvider in MVC2
I noticed it never works any more. For example I have the following code:
I have two types of roles [Admin, HelpDeskAdmin]. I have a single logon view(both
I am using MembershipServices. I have some other tables that I need to associate
I have a BaseController that I'm using to house my cross cutting concerns for
I have been working on an MVC project and I everything works at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.