I going to reset password in membership user then I have entered the same (old) password into the new password field then If password is same then display message .
object objUserID = (System.Guid)Membership.GetUser(strEmployerUserName).ProviderUserKey;
MembershipUser objUsr = Membership.GetUser(objUserID);
string strPassword = objUsr.ResetPassword(objCurrentPortalUser.UserTypeLK);
boolResult = objUsr.ChangePassword(strPassword, strNewPassword);
I used membership control...Please help me...
First try to validate the new password, if it is successful which means it is same as old password, throw exception otherwise you are good to go.
use Membership.ValidateUser(UserName, newPassword);
When you use passwordFormat as Hashed, membership will not allow to retrieve password text because it is one way hash (most secured), to validate it compares hash of passwords to be equal.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)