Unable to get value from newly created property in Member
I am Creating a new member in Umbraco like this
var member = new MembershipManager.BLL.Member();
var umbMember = memberService.CreateWithIdentity(userName, userName, "", "Member");
memberService.SavePassword(umbMember, password);
umbMember.IsApproved = true;
memberService.Save(umbMember);
memberService.RebuildXmlStructures();
After this step, I am trying to access a value inside one of its property (property is made of Umbraco ArchType)
var memData = umbMember.getProperty("myOrder").Value;
And it is giving me Null.
Once I go to Membership area and manually save this new member again it is giving me correct value
{"fieldsets":[]}
How can I enable this Via code so that after creating each member I don't have to go and save it in Umbraco Back Office
If I'm understanding this correctly, you just need to set the default value when creating the member, you can use the SetValue method on the member like this:
member.SetValue("myOrder", "{\"fieldsets":[]}\");
I'm not 100% sure that the second parameter is correct here but should put you on the right path at the very least.
Unable to get value from newly created property in Member
I am Creating a new member in Umbraco like this
After this step, I am trying to access a value inside one of its property (property is made of Umbraco ArchType)
var memData = umbMember.getProperty("myOrder").Value;
And it is giving me Null. Once I go to Membership area and manually save this new member again it is giving me correct value
How can I enable this Via code so that after creating each member I don't have to go and save it in Umbraco Back Office
Hi athul,
If I'm understanding this correctly, you just need to set the default value when creating the member, you can use the
SetValue
method on the member like this:I'm not 100% sure that the second parameter is correct here but should put you on the right path at the very least.
is working on a reply...