Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can I programmatically validate the current password then change it with the new password in membership ?
and how can i reset the password when forgotten and send email with the reset link ?
Posted

1 solution

Use ChangePassword Method from MembershipUser class.

C#
var user = Membership.GetUser("user name");
user.ChangePassword("old Password","New Password");


http://msdn.microsoft.com/en-IN/library/system.web.security.membershipuser.changepassword.aspx[^]
 
Share this answer
 
Comments
Ahmad Abd-Elghany 20-Apr-13 13:14pm    
How can i valdiate the old password , when he enter wrong old password it fire an error !
vijay__p 20-Apr-13 13:17pm    
If old password is invalid then ChangePassword method will return false, so then you can take proper action based on that.
Member 13703371 10-Oct-20 7:38am    
Hi ,

How to programmatically C# change/reset FTP password.


Thanks
Sriram
OriginalGriff 10-Oct-20 8:27am    
Don't scattergun the same request all over the site: you have a question in QA, leave it at that.
All you will do is duplicate work, and annoy those you want help from ...

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