AI OnAI Off
Fastest way is to use the episerver property control:
<EPiServer:Property PageLinkProperty="hoteldetailspage" runat="server" PropertyName="PageLink" />
Or you can add an href like this:
<a href='<%= GetUrl(CurrentPage) %>' title="View Details">
View Details </a>
with the following method in codebehind:
protected string GetUrl(PageData page) {
PageReference hotelDetailReference = page["hoteldetailspage"] as PageReference;
PageData hotelDetailPage = null;
if (hotelDetailReference != PageReference.EmptyReference)
hotelDetailPage = GetPage(hotelDetailReference);
return hotelDetailPage != null ? hotelDetailPage.LinkURL : "#";
}
I have a page called hotel list, which lists hotels. Each hotel has a link called "View details". Clicking this hould open a page displaying hotel details.
How do I format the link to open the details page (hotelsDetails.aspx)?
What I have done so far:
-I have created pagetypes for both.
- I have createdthe pages in Edit mode. Hotel Details page is not shown in frontend menu.
- Hotel list page has a property 'hoteldetailspage' of type Page. It links to Hotel details page.
I'm using EPiServer v4.61
Any help appreciated.