Page Type Builder might be one of the best things that happened to EPiServer CMS over the last couple of years. I strongly recommend you to use it. With that said, I want to share a small debugging tip that is very useful while using Page Type Builder. Debugging is in general a lot about inspecting your objects values. Visual Studio offers different approaches for this, like watches, the immediate window or just hovering your objects and inspect the tooltip to mention a few. I usually prefer the last one. It is quick and easy but you often ends up in a lot of scrolling and traversing through deep object graphs. This tip is as simple as showing you how to customize the tooltip to display the most relevant values for you immediately.
Back to Page Type Builder, if you hover a page type class, all you get is the name of the anonymous type generated behind the scenes. Not so useful, which means you need to expand and scroll in the tooltip to find the PageLink for instance.

When working with Page Type Builder it’s recommended that you create a base class that all your page type classes inherit from. This class can be decorated with attributes which applies to all your page type classes. In this example I will use the DebuggerDisplayAttribute (see Using DebuggerDisplay Attribute for more info).
[DebuggerDisplay("PageName: {PageName} PageLink: {PageLink}")]
public class BasePageData : TypedPageData
{
}
This will result in the following tooltip

This post was first published on EPiServer World, available here.