Create a new dynamic property by code



I need to create a dynamic property in code and save it. How can I create a dynamic property? I can update the dynamic property but coudn't creat one

DynamicProperty dynProperty = DynamicProperty.Load(page.PageLink, "DynProp");
dynProperty .PropertyValue.Value = "value";
dynProperty .Save();

Dec 30, 2013 11:56

I also tried the below but of no avail


otherProp = new PageDefinition();

otherProp.FieldOrder = prop.FieldOrder;

otherProp.Type = new PageDefinitionType(prop.Type.ID, prop.Type.DataType, prop.Type.Name);

otherProp.PageTypeID = page.ID;

otherProp.Tab = prop.Tab;

otherProp.Name = prop.Name;

otherProp.HelpText = prop.HelpText;

otherProp.EditCaption = prop.EditCaption;

otherProp.Searchable = prop.Searchable;

otherProp.Required = prop.Required;

otherProp.LanguageSpecific = prop.LanguageSpecific;

otherProp.LongStringSettings = prop.LongStringSettings;




Dec 31, 2013 6:50

This should work for you.

DynamicProperty dynamicProperty = DynamicProperty.Load(e.PageLink, "BlogPageReference");
 dynamicProperty.PropertyValue.Value = e.PageLink;


Edited, Jan 01, 2014 7:54
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.