I have developed a server control inherited from WebControl that wraps any number of child controls and changes their output. The control class is very simple and only contains the RenderContents method.
Here is an example of how it has been placed on the page. (Not included: registration of control namespaces.) The intention here is that the rendered output from the RichImageField control will be changed:
<RX:HideWhitespaceControl runat="server">
<PublishingWebControls:RichImageField
FieldName="PublishingPageImage"
runat="server"
id="PageImage">
</PublishingWebControls:RichImageField>
</RX:HideWhitespaceControl>
However when I try to browse to the page none of the code in my control class appears to execute and I receive the following error:
Parser Error Message: Type 'RX.SharePoint.Common.Controls.HideWhitespaceControl' does not have a public property named 'RichImageField'.
I'm confused about why this error is appearing. There is indeed no public property named RichImageField as this is not a property but rather a child control!
My custom control is being used in a SharePoint publishing site on a page layout so I'm not sure if this error is coming from SharePoint. But it looks like a basic ASP.NET error so what am I missing?