episerver

Set internal shortcut when creating page from code in EPiServer


How can I set an internal shortcut on a new page that is create from code-behind?

Stig


Solution

  • I believe something like this should work:

    int shortcutId = ...;
    
    newPage.LinkType = PageShortcutType.Shortcut;
    newPage.Property["PageShortcutLink"].Value = new PageReference(shortcutId);