Tuesday, 1 May 2007

Composite (Web) Controls and INamingContainer

When creating a .NET 2.0, composite, web control - if you wish to handle events within your control (e.g. table with a built in "next page" button), remember to implement INamingContainer.

There are no methods to implement - just the interface itself, which notifies the runtime that it should enable the control to handle events itself (rather than simply defining event handlers to bubble them out to listeners).

Failure to do so results in 3.5 hours of stupifying, pointless, wasted investigation.