<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Displaying [foo] on every page of an ASP.NET MVC application</title>
	<atom:link href="http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/</link>
	<description></description>
	<lastBuildDate>Thu, 25 Feb 2010 20:23:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ASP.NET MVC views and their data (Where does it come from??)</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-609</link>
		<dc:creator>ASP.NET MVC views and their data (Where does it come from??)</dc:creator>
		<pubDate>Tue, 24 Feb 2009 11:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-609</guid>
		<description>[...] For additional reading check out this, this and this [...]</description>
		<content:encoded><![CDATA[<p>[...] For additional reading check out this, this and this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Natalie</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-469</link>
		<dc:creator>Natalie</dc:creator>
		<pubDate>Fri, 31 Oct 2008 13:28:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-469</guid>
		<description>Graet post mate. Kepp them coming....</description>
		<content:encoded><![CDATA[<p>Graet post mate. Kepp them coming&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Estevez</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-310</link>
		<dc:creator>Estevez</dc:creator>
		<pubDate>Thu, 14 Aug 2008 07:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-310</guid>
		<description>Thanx!</description>
		<content:encoded><![CDATA[<p>Thanx!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aaron</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-309</link>
		<dc:creator>aaron</dc:creator>
		<pubDate>Wed, 13 Aug 2008 12:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-309</guid>
		<description>@estevez The RenderAction I spoke of here was custom code available from the link I gave. But it&#039;s since been included in the MVC framework (new in Preview 4 I think). You&#039;ll have to download and build the source from codeplex (www.codeplex.com/aspnet) to get it, but if you&#039;re going to use that functionality I&#039;d recommend using the baked in version.</description>
		<content:encoded><![CDATA[<p>@estevez The RenderAction I spoke of here was custom code available from the link I gave. But it&#8217;s since been included in the MVC framework (new in Preview 4 I think). You&#8217;ll have to download and build the source from codeplex (www.codeplex.com/aspnet) to get it, but if you&#8217;re going to use that functionality I&#8217;d recommend using the baked in version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Estevez</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-308</link>
		<dc:creator>Estevez</dc:creator>
		<pubDate>Wed, 13 Aug 2008 12:22:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-308</guid>
		<description>At 3. solution
- what do I have to refer to (set reference to, Import, etc)
to use &quot;RenderAction&quot; method?

I have RenderControl, RenderChildren, but there is no RenderAction...

... or i just have to upgrade?</description>
		<content:encoded><![CDATA[<p>At 3. solution<br />
- what do I have to refer to (set reference to, Import, etc)<br />
to use &#8220;RenderAction&#8221; method?</p>
<p>I have RenderControl, RenderChildren, but there is no RenderAction&#8230;</p>
<p>&#8230; or i just have to upgrade?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http-kolman.myopenid.com-</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-307</link>
		<dc:creator>http-kolman.myopenid.com-</dc:creator>
		<pubDate>Wed, 09 Apr 2008 15:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-307</guid>
		<description>If you need to aggregate all the data request calls, as in the case of multitier application, choice 3 is not really suitable - it could end up in a number of small calls to business logic layer. I would prefer all the data-gathering logic to happen before any view is rendered.

In classic ASP.NET, this is enabled by the DataSourceControls and the hidden asynchronous nature of DataSourceView&#039;s Select method. One of the arguments of this method is callback delegate, that the DataSourceView calls when the data are available. You can write your own DataSourceView that defers actual executing of the data retrieval code to the point that all the DataSourceControls in page (including those in master pages and user controls) have de facto registered their data requests by calling the Select method, and you can aggregate all these requests to a single call over remote boundary. This is enabled by multiphase lifecycle of the Page class and it&#039;s controls.

Because MVC has no tricky lifecycle (which is cool), it seems like the master page is not the right place to make any additional data requests. In my opinion, that only violates the principle of separation of concerns. So the right approach would be to find some way how to compose the controllers before the view is rendered. Creating a base controller class (&quot;master page controller&quot;) could be a solution, but it smells to me a bit as it limits composition.</description>
		<content:encoded><![CDATA[<p>If you need to aggregate all the data request calls, as in the case of multitier application, choice 3 is not really suitable &#8211; it could end up in a number of small calls to business logic layer. I would prefer all the data-gathering logic to happen before any view is rendered.</p>
<p>In classic ASP.NET, this is enabled by the DataSourceControls and the hidden asynchronous nature of DataSourceView&#8217;s Select method. One of the arguments of this method is callback delegate, that the DataSourceView calls when the data are available. You can write your own DataSourceView that defers actual executing of the data retrieval code to the point that all the DataSourceControls in page (including those in master pages and user controls) have de facto registered their data requests by calling the Select method, and you can aggregate all these requests to a single call over remote boundary. This is enabled by multiphase lifecycle of the Page class and it&#8217;s controls.</p>
<p>Because MVC has no tricky lifecycle (which is cool), it seems like the master page is not the right place to make any additional data requests. In my opinion, that only violates the principle of separation of concerns. So the right approach would be to find some way how to compose the controllers before the view is rendered. Creating a base controller class (&#8220;master page controller&#8221;) could be a solution, but it smells to me a bit as it limits composition.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aaron</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-306</link>
		<dc:creator>aaron</dc:creator>
		<pubDate>Wed, 12 Mar 2008 16:31:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-306</guid>
		<description>Some of this is a little moot with the newest MVC Preview 2 release, but given what I wrote in the post, the easiest to test would be choices 2 and 3.
Choice 2 is easy to test because you can write tests for the OnPreAction for each controller (or a base controller).
Choice 3 is easy to test because you&#039;ve effectively &quot;siloed&quot; the functionality into a specific controller/action/view, which you&#039;re already testing just like the rest.
I&#039;m also not a unit test expert (not by a long shot) so take this with a grain of salt. :)</description>
		<content:encoded><![CDATA[<p>Some of this is a little moot with the newest MVC Preview 2 release, but given what I wrote in the post, the easiest to test would be choices 2 and 3.<br />
Choice 2 is easy to test because you can write tests for the OnPreAction for each controller (or a base controller).<br />
Choice 3 is easy to test because you&#8217;ve effectively &#8220;siloed&#8221; the functionality into a specific controller/action/view, which you&#8217;re already testing just like the rest.<br />
I&#8217;m also not a unit test expert (not by a long shot) so take this with a grain of salt. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Reynolds</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-305</link>
		<dc:creator>Bryan Reynolds</dc:creator>
		<pubDate>Wed, 12 Mar 2008 16:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-305</guid>
		<description>I was glad you took the time to blog about this.  The decision here is not an easy one.  I am not a unit testing expert yet so I will ask the question.  What of the possible solutions above is easiest to test?</description>
		<content:encoded><![CDATA[<p>I was glad you took the time to blog about this.  The decision here is not an easy one.  I am not a unit testing expert yet so I will ask the question.  What of the possible solutions above is easiest to test?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Scheirman</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-304</link>
		<dc:creator>Ben Scheirman</dc:creator>
		<pubDate>Tue, 05 Feb 2008 17:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-304</guid>
		<description>Your RenderAction extension method has some of the same concerns as the rails folks did with components.  They aren&#039;t recommended now due to perf reasons and separation of concerns, and the rails team now favors the use of :before_filter&#039;s (OnPreAction).

Your last example could use a UserControl instead of the RenderAction, provided the required data already existed in ViewData.</description>
		<content:encoded><![CDATA[<p>Your RenderAction extension method has some of the same concerns as the rails folks did with components.  They aren&#8217;t recommended now due to perf reasons and separation of concerns, and the rails team now favors the use of :before_filter&#8217;s (OnPreAction).</p>
<p>Your last example could use a UserControl instead of the RenderAction, provided the required data already existed in ViewData.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W&#246;chentliche Rundablage: ASP.NET, ASP.NET MVC, System.AddIn, Silverlight, LINQ, C# 3.0, WPF, XBAP&#8230; &#124; Code-Inside Blog</title>
		<link>http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/comment-page-1/#comment-303</link>
		<dc:creator>W&#246;chentliche Rundablage: ASP.NET, ASP.NET MVC, System.AddIn, Silverlight, LINQ, C# 3.0, WPF, XBAP&#8230; &#124; Code-Inside Blog</dc:creator>
		<pubDate>Mon, 04 Feb 2008 19:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/26/displaying-foo-on-every-page-of-an-aspnet-mvc-application/#comment-303</guid>
		<description>[...] Displaying [foo] on every page of an ASP.NET MVC application [...]</description>
		<content:encoded><![CDATA[<p>[...] Displaying [foo] on every page of an ASP.NET MVC application [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
