November Happy Hour will be moved to Thursday December 5th.

Saving Page through PageData Object

Vote:
 

We have created a PageType which doesn't have any properties.  This points to  blank.aspx which doesn't have any content. The pages will be either external links or shortcut to episerver page.   All the pages of this PageType are created within a container(parent) page.  We are creating these pages using EPiServer PageData Object.  When we assign PageShortType.External to linktype of pagedata object and external url to LinkUrl, it is showing correctly in edit mode and saved correctly also.But when we assign PageShortcutType.Shortcut and select EPiServer Page and assign its URL, it is not assigning that url and assigning Blankpage.aspx url and also setting the shortcut type as 'Link to this page' in edit  mode.  Please help us in creating a page which is a shortcut to another page in episerver through pagedata object.

 

Regards

KPK

#21244
Jun 23, 2008 15:18
Vote:
 

You need to set the property PageShortcutLink when using PageShortcutType.Shortcut, for example:

page["PageShortcutLink"] = new PageReference(3);

 

#21246
Jun 23, 2008 15:40
Vote:
 
It worked.  Thanks.  One more thing-I want to assign ["PageTargetFrame"] also through code. (Whether it should open in a new window or the same window).  I have been searching for code and I could not find one.  Please let  me know how to set this.
#21257
Jun 24, 2008 11:59
Vote:
 

using EPiServer.DataAbstraction; 

page["PageTargetFrame"] = Frame.Load("_blank").ID;

#21262
Jun 24, 2008 14:57
Vote:
 
Thanks.  It worked
#21264
Jun 24, 2008 15:22
* 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.