London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
int intRefId = 123; // id to parent
PageReference prParent = new PageReference(intRefId);
PageData pdNewEpiPage = null;
pdNewEpiPage = EPiServer.DataFactory.Instance.GetDefaultPageData(prParent, "MyPageTypeName", EPiServer.Security.AccessLevel.NoAccess);
pdNewEpiPage.PageName = "My Instance Name";
pdNewEpiPage.SetValue("Prop1", "My Prop1 Value");
pdNewEpiPage.SetValue("Prop2", "My Prop2 Value");
PageReference prNewEpiPage = EPiServer.DataFactory.Instance.Save(pdNewEpiPage, EPiServer.DataAccess.SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
int intNewId = prNewEpiPage.ID;
// Done !
Maybe this is not what you asked, please comment if so !