Setting EPiServer 6r2 PageTypeBuilder Default Property Values

This is how you set default values for PTB 2.0 poperties in Episerver 6r2:
In the [PageTypeProperty] method attribute, add:


The DefaultValue could be any type of object. The EPiServer.DataAbstraction.DefaultValueType.Value is just an enum that indicates that a default value should be used.

However this has to be done before the page is created for the first time, else it wont have any effect until next time a page is created.

Another approach, if suitable, could be to just add the “Required” in the first place to avoid missing values from the editors.


 In EPiServer 7 this approach can be used:
See below heading “Default property values” here:

Leave a Reply