One user on my previous post on ProcessGenerateCode asked how he could associate a ControlBuilder not with a control, but with the page itself. There is in fact a way to do it, and it?s another one of those things that have never really been advertized. The trick is that instead of associating the ControlBuilder using the standard ControlBuilderAttribute, you need to use a FileLevelControlBuilderAttribute. Let?s walk through a little example. First, we create a custom page type with that attribute: [ FileLevelControlBuilder ( typeof ( MyPageControlBuilder ))] public class MyPage : Page { } We could do all kind of non-default thing in the derived Page, but I?ll keep it simple. Now let?s write the ControlBuilder for it: // Note that it must extend...(read more) ...
Go to the complete details ...