This post is a contribution from Deepak Kumar, an engineer with the SharePoint Developer Support team.
With “Page” content type, we can create “Edit” fields for the custom fields and display them when the page gets into “Edit” mode. To do this, we need to create a custom site column and associate it to the “Page” content type. Now, add a delegate control to the master page of the site to show the custom column of the “Page” content type in the page edit mode.
In a sub-site, when I tried to add this custom editor control, I received a NullReferenceException: DelegateControl: Exception thrown while adding control ‘****’: Object reference not set to an instance of an object .
After debugging the code, I figured out that the error was coming in below lines: