Virtual Happy Hour is canceled this month (March) due to Good Friday.
Try our conversational search powered by Generative AI!
AI OnAI Off
Virtual Happy Hour is canceled this month (March) due to Good Friday.
I assume (havn't tested it) that this code would do the trick:
PageData newPage = EPiServer.DataFactory.Instance.GetDefaultPageData(parentId, "pageTypeWithLinkColProperty");
LinkItemCollection linkCol = new EPiServer.SpecializedProperties.LinkItemCollection();
LinkItem item = new LinkItem();
item.Href = page.LinkURL;
item.Text = page.PageName;
item.Title = page.PageName;
item.Target = "_self";
linkCol.Add(item);
newPage.Property["MyLinkItemCol"].Value = linkCol;
// set other required property values and save page
Dear All,
Has anyone created the Link Collection Property dynamically through code behind. My problem is, I need to create Epi-Server Pages Dynamically, which also contains a link collection property and i need to popuplate them dynamically on the fly.
Please if some one help and send me the code.
Thanks in advance.
Tony