Click here to Skip to main content
15,898,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

i use below code to change password of user it return true value but after changing password i am not login with new password.

but old password is working.

whats wrong in code or any thing else please let me know if any how to solve this.

i already get true value when password is changed.

C#
string username = "username";
                string password = "newpassword";
                MembershipUser mu = Membership.GetUser(username);
                if (mu.ChangePassword(mu.ResetPassword(), password))
                {
                    string pass = mu.GetPassword();
                    Membership.UpdateUser(mu);
                    string= "Success";

                }
                else
                {
                    string = "Fail";

                }


- i debug code and always go to success and not get any error

-thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900