代码之家  ›  专栏  ›  技术社区  ›  Lanceomagnifico

如何在EPiServer中获取PageDefinitionTypePlugIn属性的父页?

  •  1
  • Lanceomagnifico  · 技术社区  · 16 年前

    我有一个[PageDefinitionTypePlugIn]属性串(它是一个dropdownlist),我希望能够检测出它的父页是什么。一般来说,Global.EPDataFactory.CurrentPage返回页面工作正常,但在创建新页面时,CurrentPage返回null。

    谢谢, 兰斯

    1 回复  |  直到 16 年前
        1
  •  2
  •   Daniel    16 年前
    protected void Application_Start( object sender, System.EventArgs e ) {
     EPDataFactory.CreatingPage += new EPiServer.PageEventHandler( OnCreatingPage );
    }
    
    private void OnCreatingPage( object sender, EPiServer.PageEventArgs e ) {
      e.TargetLink <-- should be the parent
    }