I think CreatedPage is raised after the page has been saved, so any changes you make to the PageData object won't be persisted. Try the CreatingPage event instead, it's raised during the save process. Or perhaps LoadingDefaultPageData or LoadedDefaultPageData would be even better, if you want to set a default value.
EPiServer Development Team
Tested the creatingpage event, no success. The loadingdefaultdata and loadingdefaultdata is raised before the page is created? If I use them I cant check which pagetype the page is, because is doesnt exist.
void Instance_CreatingPage(object sender, EPiServer.PageEventArgs e)
if (e.Page.PageTypeID == PropertyHelper.GetPropertyFromSettingsPage<int>("InfoPageType"))
string user = PrincipalInfo.CurrentPrincipal.Identity.Name;
MembershipUserCollection users = Membership.GetAllUsers();
foreach (MembershipUser u in users)
if (user == u.UserName)
PageData clone = e.Page.CreateWritableClone();
clone.Property["PageResponsible"].Value = user;
DataFactory.Instance.Save(clone, EPiServer.DataAccess.SaveAction.Publish); } } } } }
As Per says, LoadedDefaultPageData should do the trick, but not sure if they've changed the way it works.
I have a custom property (dropdown list) that I want to set automaically when a page is created. The custom property have to be editable when the page is created.
I have tried to create a DataFactory.Instance.CreatedPage += new PageEventHandler(Instance_CreatingPage); in global where I set my custom property and save. DataFactory.Instance.Save(clone, EPiServer.DataAccess.SaveAction.ForceCurrentVersion); but the property is not set after the page is published. Ideas anyone?