if (System.Web.Security.Membership.ValidateUser(username, model.OldPassword))
{
var memberService = Services.MemberService;
var member = memberService.GetByUsername(username);
memberService.SavePassword(member, model.NewPassword);
memberService.Save(member);
return Redirect("/");
}
I get this error: This provider does not support manually changing the password
I know that i can set allowManuallyChangingPassword="true" on the UmbracoMembershipProvider, but is there any other way ?
var user = Members.CurrentUserName;
if (Members.GetByUsername(user) != null)
{
var services = Current.Services.MemberService;
var servicesResult = services.GetByUsername(user);
services.SavePassword(servicesResult, model.Password);
}
or you can also try :
if (Members.GetByEmail(model.Email) != null)
{
var services = Current.Services.MemberService;
var servicesResult = services.GetByEmail(model.Email);
services.SavePassword(servicesResult, model.Password);
}
Programaticaly change password
How can i change members password?
When I try this:
I get this error: This provider does not support manually changing the password
I know that i can set
allowManuallyChangingPassword="true"
on the UmbracoMembershipProvider, but is there any other way ?BR
Please try this code block :
or you can also try :
is working on a reply...