Click here to Skip to main content
15,035,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Day, All i have this code to change password,



C#
MembershipUser user = Membership.GetUser(User.Identity.Name);
if( user.ChangePassword(txtoldpassword.Text, txtNewpassword.Text))

{

    MyClass.MyAlert(this, "Successful", "123");
    return;
}
 else
{
    MyClass.MyAlert(this, "Change failed. Please re-enter your values and try again", "123");
    return;
}


when i try it, it will successfully change but i can still be able to log in with the old password but
can not log in with the new password meaning the password stuff didnt work? and secondly the Lastpassword change date will change but the password won't change,
how do i get it right?... thanks
Posted
Updated 5-Sep-14 16:51pm
v2
Comments
Nathan Minier 5-Sep-14 14:05pm
   
What are you using for a membership provider?
Difameg Network Nigeria 6-Sep-14 6:06am
   
can you please explain more as i didnt get your question!
Nathan Minier 8-Sep-14 8:51am
   
A membership provider is the system that you have in place to track login information.

I'm assuming that you have a database back-end to keep track of users (rather than a domain, xml, external service) so you need to make sure that the account you're using on the database server has update access as well as read and create. The actual mechanics of this vary from database to database, but that is the most likely source of your issues.
pradiprenushe 5-Sep-14 22:53pm
   
Verify username for which you are changing pasword is correct.
Difameg Network Nigeria 6-Sep-14 6:04am
   
yea it is correct, the issue here is when i change the password, the lastpassword change date of that username will change to the that date,but the password won't change... i have tried using changepassword question of thesame username, it works perfectly well.. could it be that i am missing something?
[no name] 29-Sep-14 2:59am
   
Have you checked the texbox values are correct? I mean are you getting the new password in the place of new password?some times we do the configuration mistakes :)

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




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