Assembly: EPiServer.Web.WebControls (in EPiServer.Web.WebControls.dll) Version: 5.2.375.236
Syntax
| C# |
|---|
[ValidationPropertyAttribute("PropertyValue")] [DefaultPropertyAttribute("PropertyName")] public class Property : WebControl, INamingContainer, IPageSource, IPageControl |
Remarks
Examples
<EPiServer:Property PropertyName="PageName" runat="server" />
For the Property control to be able to read the properties from the page, it needs to be hosted on a web form or a control that implements the IPageSource interface. The control will iterate through the control hierarchy looking for this interface, and when it finds one it will use the CurrentPage property to read the information about the specific built-in or custom property.
If you put a Property control inside a templated control like the PageList control, that implements IPageSource, the Property control will use the CurrentPage property of the template control instead. The PageList then points the Property control to the current PageData object in its internal PageDataCollection. This is why the two following PageList examples will print the same:
<EPiServer:PageList PageLink="<%#EPiServer.Core.PageRegerence.StartPage%>" runat="server">
<ItemTemplate>
<EPiServer:Property PropertyName="PageName" runat="server" />
</ItemTemplate>
</EPiServer:PageList>
<EPiServer:PageList PageLink="<%#EPiServer.Core.PageRegerence.StartPage%>" runat="server">
<ItemTemplate>
<%#Container.CurrentPage.PageName%>
</ItemTemplate>
</EPiServer:PageList>
Inheritance Hierarchy
System.Web.UI..::.Control
System.Web.UI.WebControls..::.WebControl
EPiServer.Web.WebControls..::.Property