Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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