EPiServer has introduced a whole load of cool new features to the forthcoming EPiServer 7 Preview. One of them is native support for strongly typed page types. Strongly typed page types has been available in the popular PageTypeBuilder project in previous versions of EPiServer for a while but now its built right into the core framework.

This is exciting stuff and something I am sure we are all eager to use. In many scenarios I am I think there is a good chance that projects which are due to be upgraded to EPiServer 7 already use PageTypeBuilder. So I wanted to put a post together that compares PageTypeBuilder with EPiServer 7 typed pages, including how to map from one to the other.

First of all I wanted to compare the differences when referencing the page type from a page template (note: this example is for traditional web forms, MVC is supported but that is a different subject!).

Referencing typed pages in EPiServer 7 Preview

public partial class YourPageTemplate : EPiServer.TemplatePage

Referencing typed pages in PageTypeBuilder

public partial YourPageTemplate : PageTypeBuilder.UI.TemplatePage

As you can see the only thing that differs is the namespace that the TemplatePage exists in. In most scenarios simply swapping using statements will allow us to convert from PageTypeBuilder pages to EPiServer 7 typed pages.

So far so good, what are page type definitions? This is discussed in part 2:

Part 2 - Comparing PageType declarations in PTB and EPiServer 7 Preview ยป


Comments

Recommendations for you