R – custom server control on MOSS publishing page

asp.netcode-behindmosssharepoint

The question was:

I've got a page in a MOSS 2007
publishing site that uses a layout
(the page inherits from
Microsoft.SharePoint.Publishing.TemplatedRedirectionPage),and
I need to write a codebehind for this
page, but still let the layout
templating mechanism work.

My attempt was to write a class that
inherits from
Microsoft.SharePoint.Publishing.TemplatedRedirectionPage,
and then change the page to inherit
from my class. The page behaves
normally (i.e., it worked as before),
but the methods in my code behind
class don't get called.

Anyone know what I should be doing?

But at this point, I'm pretty sure it won't work. My current direction is to try and place a custom server control on the publishing page, but I can't seem to get that working either. Is it just not possible to customize a publishing page except through its layout (which isn't an option here)?

Best Answer

As it turns out, the most straight-forward way to accomplish what I wanted was to drop a Web Part Zone on the page layout, and then use the SharePoint editing controls to add my control (which can be made into a web part trivially).

All is well, and I didn't have to do anything freaky.