Search code examples
asp.netasp.net-membershippasswordsmembership

membership change password


how can i change password manual directly in table membership? passwordformat=1, so how can i crypt password before insert into table?


Solution

  • There's a hack you can use:

    Assuming you're not requiring the Security Question / Answer feature, you can call the ResetPassword() method in the membership API and then use the return value of that method as the old value for ChangePassword().

    Something like this:

     Membership.GetUser().ChangePassword(Membership.GetUser().ResetPassword(), "new password");
    

    There's a more complicated hack you can use if you are requiring the Security Q&A.