Setting ListinContainer to "same page"

Vote:
 
Is there a simple way to set ListingContainer on a newly created page to point to itself? Or do I have to save the page first, then change the ListingContainer, then publish the page? The following does not work correctly: EPiServer.Core.PageData newPage = Global.EPDataFactory.GetDefaultPageData(parentPage.PageLink, 3); newPage.PageName = "New listing page"; newPage["ListingContainer"] = newPage.PageLink; PageReference newPageRef = EPiServer.Global.EPDataFactory.Save(newPage, EPiServer.DataAccess.SaveAction.Publish);
#12469
Dec 08, 2005 15:17
Vote:
 
Hi! Use the static member SelfReference property of PageReference for this: newPage.PageName = "New listing page"; newPage["ListingContainer"] = PageReference.SelfReference; Regards, Johan Olofsson Developer ElektroPost
#14322
Dec 09, 2005 9:56
* 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.