1

我有一个 [PageDefinitionTypePlugIn] PropertyString(它是一个下拉列表),我希望能够检测它的父页面是什么。通常,Global.EPDataFactory.CurrentPage 可以正常返回页面,但在创建新页面时,CurrentPage 会返回 null。

我需要在渲染控件之前知道父级是什么,因为我正在根据当前页面在导航层次结构中的位置更改下拉列表中的值列表。

谢谢, 兰斯

4

1 回答 1

2
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
}
于 2010-02-01T14:55:58.123 回答