Display name of page
Namespace:
EPiServer.CoreAssembly: EPiServer (in EPiServer.dll) Version: 5.2.375.236
Syntax
| C# |
|---|
public string PageName { get; set; } |
Remarks
Not many page settings are under absolute editor control, but PageName is one of them.
PageName is a descriptive name given the page in Edit mode. PageName can be used to great
benefit in many cases, such as templated controls
Examples
The following example demonstrates the usage of PageName and LinkURL. The HTML code below produces two HTML table rows for every news item page displayed. The first row displays the content of the property PageStartPublish and the second row is an HTML anchor tag, where PageData.LinkURL is the relative URL for the page and PageData.PageName is used as a new headline. Note that PageData.Item is used twice in this HTML code, as the two attributes PageStartPublish and MainIntro are accessed using the indexer for the PageData property.
<EPiServer:Newslist ID="Newslistnew" Pagelinkproperty="NewsContainer" runat="server" MaxCount='<%# GetNewsCount() %>'>
<NewsTemplate>
<tr>
<td class="DateListingText"><%# Container.CurrentPage[ "PageStartPublish" ] %></td>
</tr>
<tr>
<td>
<a href="<%# Container.CurrentPage.LinkURL %>" class="StartPageHeading">
<%# Container.CurrentPage.PageName %></a> <br />
<span class="Normal">
<%# Container.CurrentPage[ "MainIntro" ] %>
</span>
</td>
</tr>
</NewsTemplate>
</EPiServer:Newslist>