Change User Password in ASP.NET Forms Authentication

前端 未结 5 1880
一生所求
一生所求 2021-01-02 16:47

I code in C# (ASP.NET) and am using Forms authentication.
I would like to know which is the best method to change a user password without using the asp:ChangePassword c

5条回答
  •  忘掉有多难
    2021-01-02 17:29

    Got it solved. Thanks to my fellow developer.

    var myUser = Membership.GetUser(userID);
    bool isChangeSuccess = myUser.ChangePassword(
        myUser.ResetPassword(),
        ActivateUserPasswordText.Text.Trim());
    

    Cant say I liked it much though.
    I thought ResetPassword() would be returning a bool.

提交回复
热议问题