Set PageData.Created or PageData.StartPublish from the code

Vote:
 
Hi I'm creating a page from the code, and i would like to set PageData.Created or PageData.StartPublish, but they are both read only. Here's a code example: PageData objPage = Global.EPDataFactory.GetDefaultPageData(objageReference, "My page type name", EPiServer.Security.AccessControlList.NoAccess); objPage.PageName = "My page name"; objNewPage.StartPublish = dtmStartPublish; //<-- cant do this, it's read only! global.epdatafactory.save(objpage, episerver.dataaccess.saveaction.publish, episerver.security.accesscontrollist.noaccess);> I'm sure there's a simple way of doing this that somone here can point out to me. Thanks in advance! /Fredrik
#12451
Nov 25, 2005 10:53
Vote:
 
Since all properties is also in the Property Collection you can set them there. objPage.Property["PageStartPublish"] = DateTime.Now.AddDay(1); /HAXEN
#14284
Nov 25, 2005 14:13
Vote:
 
Just what i was looking for, thanks! objPage.Created = objDate; //<- Nope objPage["PageCreated"] = objDate; //<- Yup! /Fredrik
#14285
Nov 25, 2005 15: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.