<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx</link><description>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.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Dew Drop - November 21, 2008 | Alvin Ashcraft's Morning Dew</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9131821</link><pubDate>Fri, 21 Nov 2008 16:33:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9131821</guid><dc:creator>Dew Drop - November 21, 2008 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.alvinashcraft.com/2008/11/21/dew-drop-november-21-2008/"&gt;http://www.alvinashcraft.com/2008/11/21/dew-drop-november-21-2008/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9133362</link><pubDate>Sun, 23 Nov 2008 07:11:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9133362</guid><dc:creator>Nikhil Kothari</dc:creator><description>&lt;p&gt;I know this is just an example scenario for the file-level control builder, but in fact for this specific scenario, there isn't a need to write a control builder.&lt;/p&gt;
&lt;p&gt;Instead one could just remap Label to MyLabel in web.config using the tag mapping feature.&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9134643</link><pubDate>Sun, 23 Nov 2008 19:55:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9134643</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Right, as Nikhil says tag remapping can be used to easily change a control type. This was just some random example to quickly demonstrate that the Page ControlBuilder does in fact get called.&lt;/p&gt;
&lt;p&gt;There is no limit to what you can do in your ControlBuilder, especially once you start using ProcessGeneratedCode (see my previous post).&lt;/p&gt;
</description></item><item><title>A Little Holiday Love From The ASP.NET MVC Team</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9242530</link><pubDate>Fri, 19 Dec 2008 20:49:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9242530</guid><dc:creator>you've been HAACKED</dc:creator><description>&lt;p&gt;A Little Holiday Love From The ASP.NET MVC Team&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9247644</link><pubDate>Mon, 22 Dec 2008 21:03:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9247644</guid><dc:creator>Vi</dc:creator><description>&lt;p&gt;This is not working for me. I've configured my website (not web app) to have my base page: &lt;/p&gt;
&lt;p&gt;[FileLevelControlBuilder(typeof(BasePageBuilder))]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public class BasePage : Page&lt;/p&gt;
&lt;p&gt;{}&lt;/p&gt;
&lt;p&gt;My BasePageBuilder:&lt;/p&gt;
&lt;p&gt;public class BasePageBuilder : FileLevelPageControlBuilder&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public override Type GetChildControlType(string tagName, System.Collections.IDictionary attribs)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return base.GetChildControlType(tagName, attribs);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;And when I put the debug on it, it does not ever hit it. &lt;/p&gt;
&lt;p&gt;Anything I'm missing?&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9247682</link><pubDate>Mon, 22 Dec 2008 21:35:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9247682</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Vi, please see the attached sample which is also using a Web Site and not a Web App. &amp;nbsp;If that one works for you, you should be able to identify what is different about your app that causes it not to work.&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9247880</link><pubDate>Mon, 22 Dec 2008 22:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9247880</guid><dc:creator>Vi</dc:creator><description>&lt;p&gt;Well it works on the sample. But it still does not hit the debug point on the GetChildControlType override. &lt;/p&gt;
&lt;p&gt;When does that get called because it works.&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9247901</link><pubDate>Mon, 22 Dec 2008 22:36:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9247901</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;It only gets called at the time the page gets parsed and compiled, so if it's already compiled you would indeed not hit this. &amp;nbsp;Try just resaving the aspx page and requesting it again, and you'll see that BP getting hit.&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9247949</link><pubDate>Mon, 22 Dec 2008 22:51:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9247949</guid><dc:creator>Vi</dc:creator><description>&lt;p&gt;I figured out the difference. It doesn't appear to work when your page is set to use a seperate code file. (Code-Behind). &lt;/p&gt;
&lt;p&gt;That sound right?&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9248075</link><pubDate>Mon, 22 Dec 2008 23:26:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9248075</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;You're right! &amp;nbsp;The good news is that it's easy to fix. &amp;nbsp;You just need to add CodeFileBaseClass=&amp;quot;MyPage&amp;quot; to the @page directive of the aspx. &amp;nbsp;This is needed because the aspx parser doesn't actually know what base type your code file uses (since it can't parse the code). &amp;nbsp;So it needs that little hint.&lt;/p&gt;
</description></item><item><title>re: Creating a ControlBuilder for the page itself</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9248258</link><pubDate>Tue, 23 Dec 2008 00:16:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9248258</guid><dc:creator>Vi</dc:creator><description>&lt;p&gt;Yup, that did it!!&lt;/p&gt;
&lt;p&gt;Awesome, thanks!&lt;/p&gt;
</description></item><item><title>Dynamic Data FAQ</title><link>http://blogs.msdn.com/davidebb/archive/2008/11/20/creating-a-controlbuilder-for-the-page-itself.aspx#9432150</link><pubDate>Wed, 18 Feb 2009 21:52:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9432150</guid><dc:creator>Ricka on Dynamic Data</dc:creator><description>&lt;p&gt;Please post corrections/new submissions to the Dynamic Data Forum . Put FAQ Submission/Correction in&lt;/p&gt;
</description></item></channel></rss>