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

Showing a parent property if currentpage property is null

Vote:
 

I have a parent page with a property called “result” which is XHTML string. This page has multiple sub pages with a property called “subResult”. On the subpages I want to display the parents “result”-property only if “subResult” is null. The “result” property can have dynamic content which use a web-usercontroler.

Are the any good solutions out there ?

#62488
Oct 25, 2012 18:03
Vote:
 

On the subpages you can have an EPiServer:Property runat="server" id="subpageresult".

In the subpages codebehind you could do something like this (pseudo code)

 

if (GetPage(CurrentPage.ParentLink)["result"] == null)

  subpageresult.PropertyName = "subResult";.

 

If you want't to display the parent page result property instead you do like this.

subresult.PropertyName="Result"

subresult.PageLink = CurrentPage.ParentLink

 

 

#62489
Oct 25, 2012 18:54
* 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.