Combining ASPX templates and portal engine templates

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

In some cases, you may need to combine ASPX page templates or external ASPX pages and the portal engine page templates. The following text describes how you can accomplish this.

 

Imagine that you have created a website using the portal engine model - this means that the master page and the other pages use portal engine page templates. The problem here is how to "insert" ASPX pages inside the same master page. Unfortunately, it's not possible to do this directly. However, you can use the following workaround:

 

Use two master pages - the portal engine master page defined in the root document of the content tree and the ASPX master page (.master file) used for all ASPX pages within the website.

 

The drawback is that you will need to manage the master page in two places. But this issue also has a simple solution:

 

Take the web parts and HTML code you have "above" the Page placeholder web part in your original master page and place them into a user control called Header.ascx. Then, take the web parts and HTML code "below" the Page placeholder and place them into a user control called Footer.ascx as shown in the following figure:

 

devguide_clip0273

 

Now delete the content of the original portal engine master page and place only the following web parts onto the master page template:

 

General/User control web part using the Header.ascx user control
Page placeholder web part
General/User control web part using the Footer.ascx user control

 

In the ASPX master page (.master file), you simply put:

 

the Header.ascx user control
the ContentPlaceHolder control
the Footer.ascx user control

 

In this way, you ensure that you can manage the header and footer in a single place for both the portal engine and ASPX master page.

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?combining_aspx_templates_and_portal_engine_templates.htm