This code uses the handy IsNullOrEmpty method of the String class to check if a value is null
(Nothing in VB) or an empty string. It also uses the Equals method to check if the page title is equal to
Untitled Page. It uses StringComparison.CurrentCultureIgnoreCase to do a case-insensitive comparison,
so untitled page or Untitled Page would both match.
Notice how the keywords Me (in VB.NET) and this (in C#) are used. These keywords are contextsensitive
and always refer to the instance of the class where they are used. In this example, Me and
this refer to the current instance of the BasePage class. This BasePage instance has a Title property
(which it inherits from Page) that can be checked for unwanted values. If it still contains the default
title (an empty string) or the text “Untitled Page,” the code raises (or throws) an exception. This immediately
stops execution of the page so you as a page developer can fix the problem by providing a valid
title before the page ends up in public. In Chapter 18 you learn more about exceptions and how to prevent
and handle them.