Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'am trying to update a member which has a property Name, Email and a custom properties etc.. and here I display some prop.
I use MembershipHelper How do I access the other prop? I want to update it programmatically.
Hi Glen
There's a bit of overlap with the Membership services and helpers in Umbraco, but I tend to use the MembershipHelper if I need to display Member content in my site, and then use the MemberService if I want to update a particular Member's properties.
https://our.umbraco.org/documentation/reference/management/services/memberservice
var memberService = Services.MemberService;
The Memberservice has GetById, GetByEmail & GetByUsername methods that return a Member object,
var myMember = memberService.GetByEmail("[email protected]");
you can then set properties on this object using
myMember.SetValue("propertyAlias", "valueToSet")
and you can save that change to the database using the MemberService
memberService.Save(myMember);
You can set the member's password using:
memberService.SavePassword(myMember,"password");
regards
Marc
Hi marc,
Thanks for the quick response I'm using template how do I access my custom props in member and also I'm using razor?
What did I missed?
but this one it work.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Can't access some member prop.
Hi,
I'am trying to update a member which has a property Name, Email and a custom properties etc.. and here I display some prop.
I use MembershipHelper How do I access the other prop? I want to update it programmatically.
Hi Glen
There's a bit of overlap with the Membership services and helpers in Umbraco, but I tend to use the MembershipHelper if I need to display Member content in my site, and then use the MemberService if I want to update a particular Member's properties.
https://our.umbraco.org/documentation/reference/management/services/memberservice
The Memberservice has GetById, GetByEmail & GetByUsername methods that return a Member object,
you can then set properties on this object using
and you can save that change to the database using the MemberService
You can set the member's password using:
regards
Marc
Hi marc,
Thanks for the quick response I'm using template how do I access my custom props in member and also I'm using razor?
What did I missed?
but this one it work.
is working on a reply...