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

发布于 2024-08-19 20:07:49 字数 235 浏览 4 评论 0原文

我有一个 [PageDefinitionTypePlugIn] PropertyString (它是一个下拉列表),我希望能够检测它的父页面是什么。一般来说,Global.EPDataFactory.CurrentPage 可以很好地返回页面,但是当创建新页面时,CurrentPage 返回 null。

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

谢谢, 槊

I've got a [PageDefinitionTypePlugIn] PropertyString (it's a dropdownlist), and I'd like to be able to detect what it's parent page is. Generally, Global.EPDataFactory.CurrentPage works fine to return the page, but when a NEW page is being created, CurrentPage returns null.

I need to know prior to the render of the control what the parent is, since I'm changing the list of values in the dropdown depending on where the current page is in the navigation heirarchy structure.

Thanks,
Lance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤单情人 2024-08-26 20:07:49
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
}
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
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文