Displaying a common property on a master page


Newbie... please be gentle.

I'm building a simple site. It currently has two page types, "Start" and "CommonPage". The "Start" page type has a property called "CommonDisclaimer". This property needs to be displayed in the footer of every page.

So, in my master page, I use the following:

<EPiServer:Property ID="Disclaimer" PropertyName="CommonDisclaimer" PageLink="<%#EPiServer.Core.PageReference.StartPage%>" runat="server" />

It works great on the homepage, but not on any of the inner pages, where I instead see a "[Error: No property "CommonDisclaimer".] message.

Oddly, if I replace the PageLink attribute with the ID of the home page, it works correctly on every page.

<EPiServer:Property ID="Disclaimer" PropertyName="CommonDisclaimer" PageLink="3" runat="server" />

Any ideas? I'm really hoping not to have to resort to the code-behind for such a simple task.

Thanks in advance.

Apr 16, 2010 22:32

I meant to clarify. The start page of the site uses the "Start" page type. Also, I'm using CMS 6.

Apr 16, 2010 22:35

I think it's a databinding problem.  The PageLink property doesn't bind automatically.

I recreated your situation.  It didn't work for me until I put this in this code-behind:


It worked fine for me after that.

Apr 16, 2010 23:20

Thanks Deane. Adding the DataBind works.

So, is this issue a quirk/bug with episerver? Shouldn't the control do the binding automatically? Or is this just how .NET is suppose to work?

Apr 16, 2010 23:34

Controls don't databind automatically.  But if you just call "DataBind" in the code-behind, it will bind every control on the page in one shot.

It wouldn't be hard to extend the EPiServer Property control as a "StartPageProperty" control which automatically bound it to the StartPage and so always pulled properties from there.  If you have a number of these, that's what I'd do.  It would be, maybe, 2-3 lines of code beyond the default class structure.

Apr 16, 2010 23:44

Ah that makes sense. Thanks again Deane.

Apr 17, 2010 0:04

Just for fun:


using System;
using EPiServer.Core;

namespace Blend.EPiServer.Controls
    public class StartPageProperty : global::EPiServer.Web.WebControls.Property
        protected override void OnLoad(EventArgs e)

            PageLink = PageReference.StartPage;

In web.config, under pages/controls:

Then, in the master page:


Edited, Apr 17, 2010 0:06

Nice. Thanks for the code. Very helpful!

Apr 17, 2010 18:59
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.