Try our conversational search powered by Generative AI!

How to set a Default value to a Episerver property.

Vote:
 

When a property is created for a page, it is possible to set a default value to that property from the admin mode.

But how does this default value works? How can we retrieve the default value from the property.

 

#29129
Apr 08, 2009 13:42
Vote:
 

Hi!

The default value works in the way that when you call DataFactory.Instance.GetDefaultPageData(parentId, pageType) the properties on the PageData will contain any default values set in admin mode.

If you direclty want to access the default value for a property definition directly from code you need to load the PageDefinition and get the DefaultValue from that object.

Regards

Per Gunsarfs
EPiServer CMS Development Team

#29130
Apr 08, 2009 14:00
* 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.