How to set a Default value to a Episerver property.

 

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
  • Member since: 2005
     

    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