November Happy Hour will be moved to Thursday December 5th.
I would like to save links to PropertyLinkCollection from code behind.
PropertyLinkCollection propertyRelatedPages = pageClone.Property["RelatedPages"] as PropertyLinkCollection; // PageProperty var linkCollectionClone = propertyRelatedPages.CreateWritableClone() as PropertyLinkCollection;
LinkItem item = new LinkItem(); var pageClone = pd.CreateWritableClone(); // Page to save PropertyLinkCollection to
/* Build the LinkItems here ....*/linkCollectionClone.SaveData(linkCollectionClone.Value as PropertyDataCollection); // Here is the problem
// In the above line my linkCollectionClone.value has all values but after casting to PropertyDataCollection the value turns null
//pd.Property["RelatedPages"].Value = linkCollectionClone.Value as PropertyDataCollection; //Save Page DataFactory.Instance.Save(pageClone, EPiServer.DataAccess.SaveAction.Publish);
How can I solve this?
Can't you just do:
pageClone["RelatedPages"] = linkCollectionClone;
and then save the page?
"God damn it, I mean Allah damn it!"
How did I miss this thanks alot.
I would like to save links to PropertyLinkCollection from code behind.