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
I've added NestedContent property for a certain member, And I tried to return the NestedConent values as I usually do for nodes, I used the below code:
member = Services.MemberService.GetByUsername(Membership.GetUser().UserName);
var NestedPackages = member.GetValue<IEnumerable<IPublishedElement>>("packages");
And I got the NestedPackages value as null.
Is there anyway to achieve it correctly ?
The member variable is of type IMember, which doesnt return iPublishedConent, it returns the raw value from the database which is in case of NestedContent a Json string. But you can convert this Json string to iPublishedContent by deserialize it via JsonConvert like this:
var NestedPackages = JsonConvert.DeserializeObject<IEnumerable<IPublishedElement>>(member.GetValue<string>("packages"));
I haven't tested the line above but i guess this could work.
I have tried this way before, but i think we have better way like getting NestedContent in Razor.
Thanks for help,
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted