how to read customer property value added to member
Hi all ,
I have added new field to Umbraco Member - text field call cRMAccount. After successful login i need to read value of this property which look like impossible (well cannot be)
umbraco 4 I used to read this from Member class
Member m = Member.GetCurrentMember(); and then m. getproperty("cRMAccount").value but in umbraco 7 I cannot find a way to do this.
I tried to use ProfileModel but that return null value for memberprofile..
ProfileModel memberprofile = Members.GetCurrentMemberProfileModel();
string crmaccountid = ""; // memberprofile.MemberProperties["cRMAccount"].Value.ToString();
if (memberprofile != null)
{
foreach (var p in memberprofile.MemberProperties)
{
if (p.Name == "cRMAccount")
{
crmaccountid = p.Value;
Session.Add("myicaccountid", crmaccountid);
break;
}
}
}
any one know how to do this please... I might get same problem when i am creating members via sign up as well , so basically looking for a method to read and write custom property to members
how to read customer property value added to member
Hi all , I have added new field to Umbraco Member - text field call cRMAccount. After successful login i need to read value of this property which look like impossible (well cannot be)
umbraco 4 I used to read this from Member class Member m = Member.GetCurrentMember(); and then m. getproperty("cRMAccount").value but in umbraco 7 I cannot find a way to do this.
I tried to use ProfileModel but that return null value for memberprofile..
any one know how to do this please... I might get same problem when i am creating members via sign up as well , so basically looking for a method to read and write custom property to members
Hi all , just found answer my self explained here because I am using surfacecontroller i need to use Services.MemberService
https://our.umbraco.org/documentation/reference/management/services/MemberService
is working on a reply...