<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BrightMix &#187; Software Development</title>
	<atom:link href="http://www.brightmix.com/blog/category/software-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightmix.com</link>
	<description></description>
	<lastBuildDate>Mon, 08 Feb 2010 05:36:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RenderPartial to String in ASP.NET MVC</title>
		<link>http://www.brightmix.com/blog/renderpartial-to-string-in-asp-net-mvc/</link>
		<comments>http://www.brightmix.com/blog/renderpartial-to-string-in-asp-net-mvc/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 00:34:07 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[asp.net mvc]]></category>

		<guid isPermaLink="false">http://www.brightmix.com/?p=2894</guid>
		<description><![CDATA[About a year ago I released some code that allowed you to render a partial view to a string inside your controllers in ASP.NET MVC (beta, at the time). While this solution worked, it required a whole bunch of code to achieve a fairly simple goal. Well, a lot has changed in the MVC world, [...]]]></description>
			<content:encoded><![CDATA[<p>About a year ago I released some code that allowed you to render a <a href="http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/">partial view to a string inside your controllers in ASP.NET MVC</a> (beta, at the time). While this solution worked, it required a whole bunch of code to achieve a fairly simple goal. Well, a lot has changed in the MVC world, and rendering a partial view to string has, thankfully, become much, much easier. (Thanks to <a href="http://cid-58da805f37f31f20.profile.live.com/">Martin</a> where I <a href="http://thriftybliss.spaces.live.com/blog/cns/">originally got this code from</a>!)</p>
<p>Below is the code I am now using to create my RenderPartialToString method:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode"><span class="rem">/// Static Method to render string - put somewhere of your choosing</span>
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> RenderPartialToString(<span class="kwrd">string</span> controlName, <span class="kwrd">object</span> viewData)
{
     ViewDataDictionary vd = <span class="kwrd">new</span> ViewDataDictionary(viewData);
     ViewPage vp = <span class="kwrd">new</span> ViewPage { ViewData = vd };
     Control control = vp.LoadControl(controlName);

     vp.Controls.Add(control);

     StringBuilder sb = <span class="kwrd">new</span> StringBuilder();
    <span class="kwrd"> using</span> (StringWriter sw = <span class="kwrd">new</span> StringWriter(sb))
     {
         <span class="kwrd">using</span> (HtmlTextWriter tw = <span class="kwrd">new</span> HtmlTextWriter(sw))
         {
             vp.RenderControl(tw);
         }
     }

    <span class="kwrd"> return</span> sb.ToString();
}</pre>
<p>As you can see, this method is much shorter and doesn&#8217;t have any sort of additional library contingencies. Pass it a path reference to your partial view and ViewData object (maybe you want that, maybe you don&#8217;t) and away you go. The following is an example of how to call the above method from your controller:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode" style="overflow-x:scroll">// Controller Method
<span class="kwrd">public</span> <span class="kwrd">string</span> Create()
{
     {...}
     var viewData = <span class="kwrd">new</span> SomeViewData { Note = n };

     <span class="kwrd">string</span> s = RenderPartialToString(<span class="str">"~/Views/Clients/Notes/ClientNotesRow.ascx"</span>, viewData);

     <span class="kwrd">return</span> s;
}</pre>
<p>That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/renderpartial-to-string-in-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC GridView &#8211; Part 2</title>
		<link>http://www.brightmix.com/blog/asp-net-mvc-gridview-part-2/</link>
		<comments>http://www.brightmix.com/blog/asp-net-mvc-gridview-part-2/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 22:18:26 +0000</pubDate>
		<dc:creator>erin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.brightmix.com/?p=2863</guid>
		<description><![CDATA[Be sure to check out the first post in our GridView series, which explains and provides code to render your GridView, including sorting and paging
In my last GridView post, I explained how BrightMix solved the problem of creating sortable, paging GridViews in ASP.NET MVC. In this post, I&#8217;ll show you how we took advantage of [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Be sure to check out the <a href="http://www.brightmix.com/blog/asp-net-mvc-gridview/">first post in our GridView series</a>, which explains and provides code to render your GridView, including sorting and paging</p></blockquote>
<p>In my last <a href="http://www.brightmix.com/blog/asp-net-mvc-gridview/">GridView post</a>, I explained how BrightMix solved the problem of creating sortable, paging GridViews in ASP.NET MVC. In this post, I&#8217;ll show you how we took advantage of the urls generated by the grid to maintain the state of the grid across postbacks.</p>
<p>When we set out to write this code, we started with the basics. We knew that we needed to create an html helper that would append the &#8220;RedirectUrl&#8221; to a url (when a user leaves a grid to view an item&#8217;s details, for example), and another helper to read that same url and send the user back to the previous page, with their grid state in tact.</p>
<p>The code for our &#8220;AddRedirectHyperLink&#8221; is fairly straightforward. As with the paging and sorting, we rely heavily on our custom query string helpers to do the bulk of the work.</p>
<pre class="csharpcode" style="height: 250px; overflow-y: scroll;"><span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> GenerateRedirectUrl(RedirectProperties properties)
{
     <span class="kwrd">string</span> redirectUrl = HttpContext.Current.Request.Path;

     <span class="kwrd">string</span> qString = QueryString.SetValues(<span class="kwrd">new</span> NameValueCollection(), HttpContext.Current.Request.RawUrl);

     <span class="kwrd">if</span> (qString.Length &gt; 0)
          redirectUrl += <span class="str">"?"</span> + qString;

     <span class="kwrd">if</span> (!properties.Href.Contains(<span class="str">"?"</span>))
          properties.Href += <span class="str">"?"</span>;
     <span class="kwrd">else</span>
          properties.Href += <span class="str">"&amp;"</span>;

     properties.Href += <span class="kwrd">string</span>.Format(<span class="str">"{0}={1}"</span>, RedirectKey, HttpUtility.UrlEncode(redirectUrl));

     <span class="kwrd">return</span> properties.Href;
}</pre>
<p>The tag on the view is also fairly straightforward. In order to generate the link, we have to populate the RedirectProperties class with the appropriate values for the text and url.<br />
<!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode"><span class="asp">&lt;%</span>=Html.AddRedirectHyperLink(<span class="kwrd">new</span> RedirectProperties { Href=Url.RouteUrl(<span class="str">"Default"</span>,
     <span class="kwrd">new</span> { action=<span class="str">"View"</span>, controller=<span class="str">"Home"</span>, id=c.Id}), Text=<span class="str">"View Details"</span> }) <span class="asp">%&gt;</span></pre>
<p>Once we had the redirect information added to the url, we needed a way to read it back out of the url, and send the user back to their previous page.</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode" style="height: 250px; overflow-y: scroll;"><span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> ReadFromRedirectUrl(RedirectProperties properties)
{
    <span class="kwrd">string</span> url = <span class="kwrd">string</span>.Empty;
    <span class="kwrd">string</span> redirectURL = QueryString.GetString(RedirectKey);
    <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(redirectURL))
    {
        <span class="kwrd">if</span> (redirectURL.Contains(<span class="str">"?"</span>))
        {
            <span class="kwrd">int</span> i = redirectURL.IndexOf(<span class="str">"?"</span>) + 1;
            NameValueCollection collection = QueryString.CreateRedirectNameValueCollection(HttpContext.Current.Request.QueryString[RedirectKey]);
            <span class="kwrd">string</span> qs = QueryString.FormatQueryString(collection);
            redirectURL = redirectURL.Substring(0, i) + qs;
        }

        url = redirectURL;
    }
    <span class="kwrd">if</span> (<span class="kwrd">string</span>.IsNullOrEmpty(url))
    {
        <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(properties.BackupHref))
            url = properties.BackupHref;
    }

    <span class="kwrd">return</span> url;
}</pre>
<p>The last step was to add the &#8220;ReadRedirectHyperLink&#8221; to our view and edit pages. You&#8217;ll notice we added an optional backup url. On the off chance the user landed on a page with out a redirect in their querystring, we don&#8217;t want the site to blow up.</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode" style="overflow-y: scroll;"><span class="asp">&lt;%</span>= Html.ReadRedirectHyperLink(<span class="kwrd">new</span> RedirectProperties
    { Text = <span class="str">"Back"</span>, BackupHref = Url.RouteUrl(<span class="str">"Root"</span>, <span class="kwrd">new</span> { action = <span class="str">"Index"</span>, controller = <span class="str">"Home"</span> }) })<span class="asp">%&gt;</span></pre>
<h2><a href="http://www.brightmix.com/wp-content/uploads/2009/10/MvcPagingGrid.zip">Click Here To Download The Code</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/asp-net-mvc-gridview-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving Tripleseat off Amazon EC2 &#8211; Drawbacks and Lessons Learned</title>
		<link>http://www.brightmix.com/blog/moving-tripleseat-off-amazon-ec2-drawbacks-and-lessons-learned/</link>
		<comments>http://www.brightmix.com/blog/moving-tripleseat-off-amazon-ec2-drawbacks-and-lessons-learned/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 23:53:16 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.brightmix.com/?p=2477</guid>
		<description><![CDATA[Way back in August of 2008 when we launched Tripleseat, our web-based restaurant CRM and event management software, we chose Amazon EC2 as our hosting platform. A few weeks ago, we moved it off of Amazon and onto our other favorite hosting service, Slicehost. Before I go into why we switched, here are the advantages [...]]]></description>
			<content:encoded><![CDATA[<p>Way back in <a href="http://www.brightmix.com/blog/product-launch-tripleseat/">August</a> of 2008 when we launched <a href="http://tripleseat.com">Tripleseat</a>, our web-based restaurant CRM and event management software, we chose <a href="http://aws.amazon.com/ec2/">Amazon EC2</a> as our hosting platform. A few weeks ago, we moved it off of Amazon and onto our other favorite hosting service, <a href="http://www.slicehost.com/">Slicehost</a>. Before I go into why we switched, here are the advantages and disadvantages of EC2 from our perspective.</p>
<h2>Advantages of EC2</h2>
<p><span class="highlight">We chose EC2 <em>primarily</em> because it would give us the ability to have automated and cheap server scaling</span>. Specifically, you can create and shut down server instances through the EC2 API. This allows you to programmatically scale your web application from zero to any number of servers based on necessity (if you got techcrunched, for instance, you&#8217;d probably need a lot) and you only pay for what you use. If you&#8217;re interested in more details about EC2 scaling, check out <a href="http://www.brightmix.com/blog/omaha-rails-presentation-amazon-ec2/">Dusty&#8217;s presentation</a>.</p>
<p>Other good things about EC2:</p>
<ul>
<li>Ability to build an image (AMI) of an existing instance. Once built, you can create any number of clones of your existing instance in just a few minutes. Since it&#8217;s a copy, you don&#8217;t have to install OS libraries, packages, patches, or otherwise on the instance. Very groovy.</li>
<li>Very active developer community around hosting on EC2. There are a lot of people using EC2 and building stuff around it.</li>
<li>It&#8217;s very affordable and competitively priced. One small EC2 instance runs about $100/month if you keep it on all the time.</li>
</ul>
<h2>Drawbacks and Disadvantages of EC2</h2>
<p>Here are a few of the disadvatanges we&#8217;ve seen and experienced with EC2.</p>
<h3>Server Configuration Woes</h3>
<p>As it turns out, <span class="highlight">it can be a real pain in the ass to set up and configure a Rails app in the cloud all by yourself</span>. We leveraged a really sweet Rails plugin called <a href="http://ec2onrails.rubyforge.org/">EC2OnRails</a>, which automates the setting up an EC2 instance for Rails hosting. EC2OnRails, doesn&#8217;t, however, help you do any sort of automatic dynamic scaling. For that, you&#8217;d need to go for something like <a href="https://scalr.net/login.php">Scalr</a> or <a href="http://www.rightscale.com/">RightScale</a>.</p>
<h3>Unrecoverable Instances</h3>
<p>If you manage to mess up your instance&#8217;s boot sequence, networking or routing configurations, or SSH server, you can easily exile yourself from an instance. More specifically, you won&#8217;t be able to log into it and fix whatever you broke. Your only options are to get support from Amazon (generally unreliable and slow from our experience) or build a new instance. Yeah, I had this happen to me a few times &#8211; one time in particular it was as a result of installing some innocent Ubuntu OS updates. That was a real bummer.</p>
<h3>Random Loss of your Instances!</h3>
<p>We&#8217;ve never had an instance vanish on us; we&#8217;ve actually had a few instances that have been running for upwards of a year now. However, there is always the looming possibility of one just going poof and being gone forever. So, if you want to roll in the EC2 cloud, you need to be able to quickly rebuild a lost instance.</p>
<h2>What Caused us to Move Tripleseat</h2>
<p>When we launched Tripleseat, we really had no idea how many users we&#8217;d have on the site all at once and how much they&#8217;d tax the server. After selling the app for several months, it became apparently that Tripleseat&#8217;s growth was going to be fairly steady and predictable. No techcrunching or YouTube-esque traffic patterns. As a result, the primary reason we chose EC2&#8211;the ability for Tripleseat to scale an infinite number of servers&#8211;wasn&#8217;t justified. 37Signals basecamp app grew in a similar fashion:</p>
<blockquote><p><span id="extended">&#8220;We ordered a dedicated server from our original web hosts at <a href="http://www.tilted.com/">Tilted</a> and turned it on. Basecamp ran on that single dedicated box for a year. One server, one year.&#8221; -Jason Fried<br />
</span></p></blockquote>
<h3>Hosting Your App on One EC2 Instance is Dangerous</h3>
<p>Back in December, our Tripleseat EC2 instance disappeared from the Internet for around an hour. There was no reason for it&#8211;we just couldn&#8217;t access tripleseat.com&#8211;and neither could our customers. Our recovery strategy was to launch a new instance from a prebuilt image, deploy the code to it, and populate the new database from backups on Amazon S3. As it turns out, this strategy means you are destined to have downtime for at least a while. We lucked out, though, as our original EC2 instance magically reappeared. But it was certainly a scary situation, and our customers were less than happy.</p>
<h2>Overall Lessons Learned</h2>
<ol>
<li><span class="highlight">If you don&#8217;t know how much traffic or bandwidth your app will require, go with a more simple and secure hosting solution</span>. You can always ramp up. (Slicehost, dreamhost, mediatemple are all good.)</li>
<li>If you want to roll on the EC2 Cloud, <span class="highlight">don&#8217;t store data on the instance or, if you do, back it up frequently (like every 5 minutes). Additionally, make an AMI of your instance so they can be easily recreated and/or cloned.</span></li>
<li>Unless you can dedicate quite a bit of time to configuring, running, and monitoring EC2 instances, I&#8217;d recommend a less risky hosting solution that provides immediate support and full, automated server backups.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/moving-tripleseat-off-amazon-ec2-drawbacks-and-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RenderPartial to String in ASP.NET MVC Beta</title>
		<link>http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/</link>
		<comments>http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 23:16:00 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[asp.net RJS]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://www.brightmix.com//2008/11/24/how-to-renderpartial-to-string-in-asp-net-mvc</guid>
		<description><![CDATA[Update! RenderPartial to String has become much easier in ASP.NET MVC, see the new post here!
We  usually don’t post much about hardcore programming-related things here, but this is an exception to the rule.
We’re primarily a Ruby on Rails shop, but we still do ASP.NET development fairly regularly. Our overall interest in ASP.NET was waning [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Update! RenderPartial to String has become much easier in ASP.NET MVC, <a href="http://www.brightmix.com/blog/renderpartial-to-string-in-asp-net-mvc/">see the new post here!</a></p></blockquote>
<p>We  usually don’t post much about hardcore programming-related things here, but this is an exception to the rule.</p>
<p>We’re primarily a <a href="http://rubyonrails.com/">Ruby on Rails</a> shop, but we still do <span class="caps">ASP</span>.NET development fairly regularly. Our overall interest in <span class="caps">ASP</span>.NET was waning until the new <a href="http://www.asp.net/mvc/"><span class="caps">ASP</span>.NET <span class="caps">MVC</span></a> framework was released. <span class="caps">ASP</span>.NET <span class="caps">MVC</span> brings a number of the concepts we love from Rails into the <span class="caps">ASP</span>.NET arena.</p>
<p>However, <span class="highlight">one limitation we’ve come across with <span class="caps">ASP</span>.NET <span class="caps">MVC</span> is the lack of ability to render a partial to a string</span>. This is really handy if you’re doing Ajax things; it also happens to be one of the things we really love about Rails. Additionally, it’s a feature others have been wanting, too, see <a href="http://ayende.com/Blog/archive/2008/11/11/another-asp.net-mvc-bug-rendering-views-to-different-output-source.aspx">here</a> and <a href="http://stackoverflow.com/questions/286132/aspnet-mvc-getting-a-paritial-views-html-from-inside-of-the-controller">here</a>.</p>
<p>Well, the good news is I have a solution for at least some of you out there. <span class="highlight">I’ve cobbled together a few concepts from various sources and forum posts to make it all happen. Here is how you can render a view into a string.</span></p>
<p>First, you need to include these files in your project, both are from the <a href="http://www.codeplex.com/MVCContrib">MvcContrib project</a>.</p>
<p style="margin-bottom:5px;font-size:15px;;"><a href="http://www.brightmix.com/assets/2008/11/16/BlockRenderer.cs">Download BlockRender.cs</a> – from MvcContrib</p>
<pre class="csharpcode" style="height: 200px; overflow-y: scroll; overflow-x: hidden;"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.IO;
<span class="kwrd">using</span> System.Web;
<span class="kwrd">using</span> System.Collections.Generic;

<span class="kwrd">namespace</span> MvcContrib.UI
{
    <span class="rem">/// &lt;summary&gt;Renders an Action delegate and captures all output to a string. &lt;/summary&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">class</span> BlockRenderer
    {
        <span class="kwrd">private</span> <span class="kwrd">readonly</span> HttpContextBase _httpContext;

        <span class="kwrd">public</span> BlockRenderer(HttpContextBase httpContext)
        {
            _httpContext = httpContext;
        }

        <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> HttpResponse
        {
            <span class="kwrd">public</span> <span class="kwrd">bool</span> UsingHttpWriter { get { <span class="kwrd">return</span> <span class="kwrd">true</span>; } }
        }

        <span class="rem">/// &lt;summary&gt;Renders the action and returns a string.&lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="viewRenderer"&gt;The delegate to render.&lt;/param&gt;</span>
        <span class="rem">/// &lt;returns&gt;The rendered text.&lt;/returns&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">string</span> Capture(Action viewRenderer)
        {
            HttpResponseBase resp = _httpContext.Response;
            Stream originalFilter = <span class="kwrd">null</span>;
            CapturingResponseFilter innerFilter;
            <span class="kwrd">string</span> capturedHtml = <span class="str">""</span>;

            <span class="kwrd">if</span> (viewRenderer != <span class="kwrd">null</span>)
            {
                <span class="kwrd">try</span>
                {
                    resp.Flush();
                    originalFilter = resp.Filter;
                    innerFilter = <span class="kwrd">new</span> CapturingResponseFilter(resp.Filter);
                    resp.Filter = innerFilter;
                    viewRenderer();

                    resp.Flush();
                    capturedHtml = innerFilter.GetContents(resp.ContentEncoding);
                }
                <span class="kwrd">finally</span>
                {
                    <span class="kwrd">if</span> (originalFilter != <span class="kwrd">null</span>)
                    {
                        resp.Filter = originalFilter;
                    }
                }
            }
            <span class="kwrd">return</span> capturedHtml;
        }
    }
}</pre>
<p style="margin-bottom:5px;font-size:15px;;"><a href="http://www.brightmix.com/assets/2008/11/16/CapturingResponseFilter.cs">Download CapturingResponseFilter.cs</a> – from MvcContrib</p>
<pre class="csharpcode" style="height: 200px; overflow-y: scroll; overflow-x: hidden;"><span class="kwrd">using</span> System.IO;
<span class="kwrd">using</span> System.Text;

<span class="kwrd">namespace</span> MvcContrib.UI
{
    <span class="kwrd">public</span> <span class="kwrd">class</span> CapturingResponseFilter : Stream
    {
        <span class="kwrd">private</span> Stream _sink;
        <span class="kwrd">private</span> MemoryStream mem;

        <span class="kwrd">public</span> CapturingResponseFilter(Stream sink)
        {
            _sink = sink;
            mem = <span class="kwrd">new</span> MemoryStream();
        }

        <span class="rem">// The following members of Stream must be overriden.</span>
        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> CanRead
        {
            get { <span class="kwrd">return</span> <span class="kwrd">true</span>; }
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> CanSeek
        {
            get { <span class="kwrd">return</span> <span class="kwrd">false</span>; }
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> CanWrite
        {
            get { <span class="kwrd">return</span> <span class="kwrd">false</span>; }
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">long</span> Length
        {
            get { <span class="kwrd">return</span> 0; }
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">long</span> Position { get; set; }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">long</span> Seek(<span class="kwrd">long</span> offset, SeekOrigin direction)
        {
            <span class="kwrd">return</span> 0;
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> SetLength(<span class="kwrd">long</span> length)
        {
            _sink.SetLength(length);
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Close()
        {
            _sink.Close();
            mem.Close();
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Flush()
        {
            _sink.Flush();
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">int</span> Read(<span class="kwrd">byte</span>[] buffer, <span class="kwrd">int</span> offset, <span class="kwrd">int</span> count)
        {
            <span class="kwrd">return</span> _sink.Read(buffer, offset, count);
        }

        <span class="rem">// Override the Write method to filter Response to a file. </span>
        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Write(<span class="kwrd">byte</span>[] buffer, <span class="kwrd">int</span> offset, <span class="kwrd">int</span> count)
        {
            <span class="rem">//Here we will not write to the sink b/c we want to capture</span>

            <span class="rem">//Write out the response to the file.</span>
            mem.Write(buffer, 0, count);
        }

        <span class="kwrd">public</span> <span class="kwrd">string</span> GetContents(Encoding enc)
        {
            var buffer = <span class="kwrd">new</span> <span class="kwrd">byte</span>[mem.Length];
            mem.Position = 0;
            mem.Read(buffer, 0, buffer.Length);
            <span class="kwrd">return</span> enc.GetString(buffer, 0, buffer.Length);

        }
    }
}</pre>
<hr />
<p>With the above two files included in your project, you’re almost ready to go. Now you just need to include a method that makes all the magic happen (more easily). <span class="highlight">As seen in the example below, define the RenderPartialToString() and then call it from your controller:</span></p>
<pre class="csharpcode" style="overflow-x:scroll"><span class="rem">/// Static Method to render string - put somewhere of your choosing</span>
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> RenderPartialToString(<span class="kwrd">string</span> userControl, <span class="kwrd">object</span> viewData, ControllerContext controllerContext)
{
    HtmlHelper h = <span class="kwrd">new</span> HtmlHelper(<span class="kwrd">new</span> ViewContext(controllerContext, <span class="kwrd">new</span> WebFormView(<span class="str">"omg"</span>), <span class="kwrd">null</span>, <span class="kwrd">null</span>), <span class="kwrd">new</span> ViewPage());
    var blockRenderer = <span class="kwrd">new</span> BlockRenderer(controllerContext.HttpContext);

    <span class="kwrd">string</span> s = blockRenderer.Capture(
        () =&gt; RenderPartialExtensions.RenderPartial(h, userControl, viewData)
    );

    <span class="kwrd">return</span> s;
}

<span class="rem">/// Your Controller method...  </span>
<span class="kwrd">public</span> ActionResult MakeStringForMe()
{
    var objectViewData = <span class="kwrd">new</span> objectViewData { SomeString = <span class="str">"Dude"</span>, SomeNumber = 1 };

    <span class="kwrd">string</span> s = RenderPartialToString(<span class="str">"~/Views/Controls/UserControl.ascx"</span>, objectViewData, <span class="kwrd">this</span>.ControllerContext);

    View();
}</pre>
<p>With a little bit of luck and good fortune, it should work and you’ll be rendering partials to strings like a machine!</p>
<h3>How It All Works</h3>
<p>Basically, it’s using the Response object to render a usercontrol and capture the output into a string. Then, it filters that rendered content out of the response with some fancy trickery. All in all, <span class="highlight">it’s definitely a hack, but it gets the job done</span>—at least until the Microsoft team can address this issue at its core (hint hint).</p>
<h3>A Few Limitiations and/or Questions</h3>
<p>I read somewhere that this might not work if you need to retrieve things out of the session. I have not verified this.</p>
<p>Additionally, I have no idea what effects using this approach will have on the large-scale performance of an app. It hasn’t caused any problems for the application I’m using it on.</p>
<p>Lastly, you cannot specify the ContentType on the response. If you do, you’ll get an exception:</p>
<blockquote><p>Server cannot set content type after <span class="caps">HTTP</span> headers have been sent</p></blockquote>
<p>This seems to be a limitation that results from rendering a usercontrol. This will be problematic if you want your controller to return data with a ContenType of, say, “text/javascript.” I ran into this problem while building a Rails-like <span class="caps">RJS</span> framework (see below), but managed to deal with it fairly elegantly.</p>
<h2>Rails-like <span class="caps">RJS</span> for <span class="caps">ASP</span>.NET <span class="caps">MVC</span></h2>
<p>In line with the ability to RenderPartial to string, <span class="highlight">I’ve also put together a Rails-like <span class="caps">RJS</span> framework for <span class="caps">ASP</span>.NET <span class="caps">MVC</span></span>. Simply put, <span class="caps">RJS</span> is a framework that renders and builds dynamic javascript on the server. Similar to Rails’ <span class="caps">RJS</span>, it’s specific to the <a href="http://www.prototypejs.org">Prototype framework</a> – sorry JQuery guys (for what it’s worth, it could probably be easily ported to JQuery!).</p>
<p>Here’s a quick snippet of what this allows you to do from your Controller:</p>
<pre class="csharpcode" style="overflow-x:scroll"><span class="rem">// Example Usage in your Controller:</span>
<span class="kwrd">public</span> ActionResult HideElement(<span class="kwrd">string</span> elementId)
{
    RjsResult r = <span class="kwrd">new</span> RjsResult();
    r.Effect(elementId, RjsResult.EffectTypes.Hide);

    <span class="kwrd">return</span> r;
}

<span class="rem">// A more complicated but powerful example of returning the contents of two UserControls and inserting them into two different &lt;div&gt;'s</span>
<span class="kwrd">public</span> ActionResult InsertUserControl()
{
    ObjectViewData viewData = <span class="kwrd">new</span> ObjectViewData { SomeString = <span class="str">"dude"</span>, SomeNumber = 1 };

    var r = <span class="kwrd">new</span> RjsResult();
    r.Insert(<span class="str">"div_one"</span>, RjsResult.Positions.Top, <span class="str">"~/Views/Controls/UserControl1.ascx"</span>, ObjectViewData, ControllerContext);
    r.Insert(<span class="str">"div_two"</span>, RjsResult.Positions.Bottom, <span class="str">"~/Views/Controls/UserControl2.ascx"</span>, ObjectViewData, ControllerContext);

    <span class="kwrd">return</span> r;
}</pre>
<p>In both of the above examples, I’m calling a few different methods on the RjsResult object. Behind the scenes, the RjsResult object is building up a string of javascript commands that make all the magic happen in the user’s browser. If you’re still confused, I suggest you read <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html">this page</a> from the Rails documentation, which might explain the concept better.</p>
<p>With that said, here is the code for my <span class="caps">ASP</span>.NET <span class="caps">MVC RJS</span> framework!</p>
<p style="margin-bottom:5px;font-size:15px;;"><a href="http://www.brightmix.com/assets/2008/11/16/RjsResult.cs">Download RjsResult.cs</a></p>
<pre class="csharpcode" style="height: 200px; overflow-y: scroll; overflow-x: hidden;"><span class="kwrd">namespace</span> System.Web.Mvc
{
    <span class="kwrd">using</span> System;
    <span class="kwrd">using</span> System.Text;
    <span class="kwrd">using</span> System.Web;
    <span class="kwrd">using</span> System.Collections.Generic;
    <span class="kwrd">using</span> System.Security.Policy;
    <span class="kwrd">using</span> System.Web.Script.Serialization;
    <span class="kwrd">using</span> MvcContrib.UI;
    <span class="kwrd">using</span> System.Web.Mvc.Html;

    [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    <span class="kwrd">public</span> <span class="kwrd">class</span> RjsResult : ActionResult
    {
        <span class="preproc">#region</span> Constructors
        <span class="kwrd">public</span> RjsResult(<span class="kwrd">bool</span> setContentType)
        {
            Actions = <span class="kwrd">new</span> List&lt;IRjsActionBase&gt;();
            <span class="kwrd">this</span>.SetContentType = setContentType;
        }

        <span class="kwrd">public</span> RjsResult() : <span class="kwrd">this</span>(<span class="kwrd">false</span>)
        {
        }
        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> Private Vars
        <span class="kwrd">private</span> <span class="kwrd">bool</span> SetContentType { get; set; }

        <span class="kwrd">private</span> List&lt;IRjsActionBase&gt; Actions
        {
            get;
            set;
        }

        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> Rjs Actions
        <span class="kwrd">public</span> <span class="kwrd">interface</span> IRjsActionBase
        {
            <span class="kwrd">string</span> Render();
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsUpdateAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsUpdateAction(<span class="kwrd">string</span> element, <span class="kwrd">string</span> contents)
            {
                <span class="kwrd">this</span>.element = element;
                <span class="kwrd">this</span>.contents = contents;
            }

            <span class="kwrd">public</span> <span class="kwrd">string</span> element { get; set; }
            <span class="kwrd">public</span> <span class="kwrd">string</span> contents { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">if</span> (!contents.StartsWith(<span class="str">"\""</span>))
                    contents = <span class="str">"\""</span> + contents + <span class="str">"\""</span>;

                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"Element.update(\"{0}\", {1});"</span>, element, contents);
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsInsertAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsInsertAction(<span class="kwrd">string</span> element, Positions p, <span class="kwrd">string</span> contents)
            {
                <span class="kwrd">this</span>.element = element;
                <span class="kwrd">this</span>.contents = contents;
                <span class="kwrd">this</span>.position = p;
            }

            <span class="kwrd">public</span> <span class="kwrd">string</span> element { get; set; }
            <span class="kwrd">public</span> <span class="kwrd">string</span> contents { get; set; }
            <span class="kwrd">public</span> Positions position { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">if</span> (!contents.StartsWith(<span class="str">"\""</span>))
                    contents = <span class="str">"\""</span> + contents + <span class="str">"\""</span>;

                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"Element.insert(\"{0}\", {{{1}: {2} }});"</span>, element, position, contents);
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsStringAction : IRjsActionBase
        {
            <span class="kwrd">public</span> <span class="kwrd">string</span> contents { get; set; }

            <span class="kwrd">public</span> RjsStringAction(<span class="kwrd">string</span> contents)
            {
                <span class="kwrd">this</span>.contents = contents;
            }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">return</span> <span class="kwrd">this</span>.contents;
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsShowAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsShowAction(<span class="kwrd">string</span> element)
            {
                <span class="kwrd">this</span>.element = element;
            }
            <span class="kwrd">public</span> <span class="kwrd">string</span> element { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"$(\"{0}\").show();"</span>, element);
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsAlertAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsAlertAction(<span class="kwrd">string</span> message)
            {
                <span class="kwrd">this</span>.message = message;
            }
            <span class="kwrd">public</span> <span class="kwrd">string</span> message { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"alert('{0}');"</span>, message);
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsHideAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsHideAction(<span class="kwrd">string</span> element)
            {
                <span class="kwrd">this</span>.element = element;
            }
            <span class="kwrd">public</span> <span class="kwrd">string</span> element { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"$(\"{0}\").hide();"</span>, element);
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsRemoveAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsRemoveAction(<span class="kwrd">string</span> element)
            {
                <span class="kwrd">this</span>.element = element;
            }
            <span class="kwrd">public</span> <span class="kwrd">string</span> element { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"$(\"{0}\").remove();"</span>, element);
            }

            <span class="preproc">#endregion</span>
        }

        <span class="kwrd">private</span> <span class="kwrd">class</span> RjsEffectAction : IRjsActionBase
        {
            <span class="kwrd">public</span> RjsEffectAction(<span class="kwrd">string</span> element, EffectTypes effect, KeyValuePair&lt;<span class="kwrd">string</span>, <span class="kwrd">string</span>&gt;[] options)
            {
                <span class="kwrd">this</span>.options = <span class="kwrd">new</span> Dictionary&lt;<span class="kwrd">string</span>, <span class="kwrd">string</span>&gt;();

                <span class="kwrd">if</span> (options != <span class="kwrd">null</span>)
                {
                    <span class="kwrd">foreach</span> (KeyValuePair&lt;<span class="kwrd">string</span>, <span class="kwrd">string</span>&gt; pair <span class="kwrd">in</span> options)
                        <span class="kwrd">this</span>.options.Add(pair.Key, pair.Value);
                }

                <span class="kwrd">this</span>.element = element;
                <span class="kwrd">this</span>.effect = effect;
            }

            <span class="kwrd">public</span> <span class="kwrd">string</span> element { get; set; }
            <span class="kwrd">public</span> EffectTypes effect { get; set; }
            <span class="kwrd">public</span> Dictionary&lt;<span class="kwrd">string</span>, <span class="kwrd">string</span>&gt; options { get; set; }

            <span class="preproc">#region</span> IRjsActionBase Members

            <span class="kwrd">public</span> <span class="kwrd">string</span> Render()
            {
                <span class="kwrd">string</span> ret = <span class="kwrd">string</span>.Format(<span class="str">"new Effect.{0}(\"{1}\""</span>, effect.ToString(), element);
                ret += <span class="str">", {"</span>;

                <span class="kwrd">foreach</span> (<span class="kwrd">string</span> key <span class="kwrd">in</span> options.Keys)
                {
                    ret += <span class="kwrd">string</span>.Format(<span class="str">"{0}: {1}"</span>, key, options[key]);
                }
                ret += <span class="str">"});"</span>;

                <span class="kwrd">return</span> ret;
            }

            <span class="preproc">#endregion</span>
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Call me from your controller and pass me your ControllerContext and I'll render a UserControl for you and return the contents as a string!</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="userControl"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="viewData"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="controllerContext"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;returns&gt;&lt;/returns&gt;</span>
        <span class="kwrd">private</span> <span class="kwrd">string</span> RenderPartialToString(<span class="kwrd">string</span> userControl, <span class="kwrd">object</span> viewData, ControllerContext controllerContext)
        {
            HtmlHelper h = <span class="kwrd">new</span> HtmlHelper(<span class="kwrd">new</span> ViewContext(controllerContext, <span class="kwrd">new</span> WebFormView(<span class="str">"omg"</span>), <span class="kwrd">null</span>, <span class="kwrd">null</span>), <span class="kwrd">new</span> ViewPage());
            var blockRenderer = <span class="kwrd">new</span> BlockRenderer(controllerContext.HttpContext);

            var r = <span class="kwrd">new</span> RjsResult();
            JavaScriptSerializer serializer = <span class="kwrd">new</span> JavaScriptSerializer();
            <span class="kwrd">string</span> s = blockRenderer.Capture(
                () =&gt; RenderPartialExtensions.RenderPartial(h, userControl, viewData)
            );

            <span class="kwrd">return</span> serializer.Serialize(s);
        }
        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> Fun Enums
        <span class="kwrd">public</span> <span class="kwrd">enum</span> Positions
        {
            Before = 1,
            After,
            Top,
            Bottom
        }

        <span class="kwrd">public</span> <span class="kwrd">enum</span> EffectTypes
        {
            Appear = 1,
            Fade,
            SlideDown,
            SlideUp,
            Shake,
            Highlight
        }
        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> Rjs Methods
        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Renders a user control and inserts the contents into specified element</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="p"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="userControl"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="viewData"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="controllerContext"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Insert(<span class="kwrd">string</span> element, Positions p, <span class="kwrd">string</span> userControl, <span class="kwrd">object</span> viewData, ControllerContext controllerContext)
        {
            Insert(element, p, RenderPartialToString(userControl, viewData, controllerContext) );
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Inserts content into specific element</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="p"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="contents"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Insert(<span class="kwrd">string</span> element, Positions p, <span class="kwrd">string</span> contents)
        {
            Actions.Add(<span class="kwrd">new</span> RjsInsertAction(element, p, contents));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Update a part of the page by rendering a user control</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="userControl"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="viewData"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="controllerContext"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Update(<span class="kwrd">string</span> element, <span class="kwrd">string</span> userControl, <span class="kwrd">object</span> viewData, ControllerContext controllerContext)
        {
            Update(element, RenderPartialToString(userControl, viewData, controllerContext));
        }

        <span class="kwrd">public</span> <span class="kwrd">void</span> Update(<span class="kwrd">string</span> element, <span class="kwrd">string</span> contents)
        {
            Actions.Add(<span class="kwrd">new</span> RjsUpdateAction(element, contents));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Alert some text</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="message"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Alert(<span class="kwrd">string</span> message)
        {
            Actions.Add(<span class="kwrd">new</span> RjsAlertAction(message));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Render some javascript code.. whatever you want</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="contents"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> RenderString(<span class="kwrd">string</span> contents)
        {
            Actions.Add(<span class="kwrd">new</span> RjsStringAction(contents));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Shows an element</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Show(<span class="kwrd">string</span> element)
        {
            Actions.Add(<span class="kwrd">new</span> RjsShowAction(element));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Hides an element</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Hide(<span class="kwrd">string</span> element)
        {
            Actions.Add(<span class="kwrd">new</span> RjsHideAction(element));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Delets an element</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Remove(<span class="kwrd">string</span> element)
        {
            Actions.Add(<span class="kwrd">new</span> RjsHideAction(element));
        }

        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Calls an effect of type EffectTypes, also takes array of prototype options</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="element"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="effect"&gt;&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name="options"&gt;&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">void</span> Effect(<span class="kwrd">string</span> element, EffectTypes effect, KeyValuePair&lt;<span class="kwrd">string</span>, <span class="kwrd">string</span>&gt;[] options)
        {
            Actions.Add(<span class="kwrd">new</span> RjsEffectAction(element, effect, options));
        }
        <span class="kwrd">public</span> <span class="kwrd">void</span> Effect(<span class="kwrd">string</span> element, EffectTypes effect)
        {
            Actions.Add(<span class="kwrd">new</span> RjsEffectAction(element, effect, <span class="kwrd">null</span>));
        }

        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> ActionResult Override
        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> ExecuteResult(ControllerContext context)
        {
            <span class="kwrd">if</span> (context == <span class="kwrd">null</span>)
            {
                <span class="kwrd">throw</span> <span class="kwrd">new</span> ArgumentNullException(<span class="str">"context"</span>);
            }

            HttpResponseBase response = context.HttpContext.Response;

            <span class="kwrd">if</span> (<span class="kwrd">this</span>.SetContentType)
                response.ContentType = <span class="str">"application/javascript"</span>;

            <span class="kwrd">string</span> result = <span class="kwrd">string</span>.Empty;

            <span class="kwrd">foreach</span> (IRjsActionBase action <span class="kwrd">in</span> Actions)
            {
                result += action.Render();
            }

            response.Write(result);
        }
<span class="preproc">#endregion</span>
    }
}</pre>
<h3 style="margin-top:15px;">One Major Gotcha</h3>
<p>A trick to getting this to work with Prototype’s <a href="http://www.prototypejs.org/api/ajax/request">Ajax.Request</a> is the ContentType of the returned data needs to be of type “text/javascript” in order for it to automatically be evaluated as javascript. However, you can get around this by forcing Prototype to evaluate the response data as javascript via the <a href="http://www.prototypejs.org/api/ajax/options">EvalJS: ‘force’</a> parameter.</p>
<p>So that’s it. A working way to RenderPartial to a string on the server-side and also the startings of a Rails-like <span class="caps">RJS</span> framework for <span class="caps">ASP</span>.NET <span class="caps">MVC</span>!</p>
<p><span class="highlight">Thoughts, comments, patches or otherwise are appreciated!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Focus on the User</title>
		<link>http://www.brightmix.com/blog/focus-on-the-user/</link>
		<comments>http://www.brightmix.com/blog/focus-on-the-user/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 05:19:00 +0000</pubDate>
		<dc:creator>Dusty</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.brightmix.com//2008/07/10/focus-on-the-user</guid>
		<description><![CDATA[I frequently comb through our archives of documents on Google Docs, and recently stumbled upon this mind-dump that I did about two years ago. It’s describing a product idea that I had for a web app, and how it could be made SO MUCH better than the existing sites out there.
It’s not about the technology [...]]]></description>
			<content:encoded><![CDATA[<p>I frequently comb through our archives of documents on Google Docs, and recently stumbled upon this mind-dump that I did about two years ago. It’s describing a product idea that I had for a web app, and how it could be made <span class="caps">SO MUCH</span> better than the existing sites out there.</p>
<p><span class="highlight" style="font-size:20px;;">It’s not about the technology <del>-</del> its about experience.</span></p>
<p>Funny thing is, here we are two years later, and we’re <a href="http://www.feistypiranha.com">finally building the product</a>&#8230; Interestingly, this is still exactly the vision and direction that we’re taking things. I encourage you to do the same… Though this was initially for our webapp, I <em>truly</em> believe that this stuff transfers. Reader’s Digest version:</p>
<p><span class="highlight" style="font-size:20px;;">Be 100 percent about the user. Provide value. Be awesome.</span></p>
<ul>
<li>Happy users = returning users = more traffic</li>
<li>Happy users tell their friends</li>
<li>Happy users don’t get frustrated, and spend more time on site</li>
<li>How to make happy user?
<ul>
<li>Site easy on the eyes
<ul>
<li>No <span class="caps">BLINKING ADS</span>!</li>
</ul>
</li>
<li>Don’t <span class="caps">FORCE ADS DOWN THEIR THROATS</span>
<ul>
<li>Google taught us that <span class="caps">RELEVANT</span>, unobtrusive ads can be <span class="caps">VERY PROFITABLE</span></li>
<li>Annoying ads are not good for the advertiser OR the user</li>
</ul>
</li>
<li>Actually <span class="caps">RELEVANT</span>, USEFUL <span class="caps">CONTENT</span> will drive the <span class="caps">MOST TRAFFIC</span>
<ul>
<li>Make a site that people actually <span class="caps">WANT TO USE</span></li>
</ul>
</li>
<li>Provide them with the information that they <span class="caps">WANT</span>
<ul>
<li>Provide value, and the people will come</li>
<li>Provide value, and the people will tell other people.</li>
</ul>
</li>
<li>Provide them with <span class="caps">USEFUL INFORMATION</span>
<ul>
<li>Don’t just put information “just because”</li>
<li>Give serious thought to providing <span class="caps">VALUE</span> to the user in every area of the site.
<ul>
<li>Why is the user visiting the ??? section? Am I solving his/her needs?</li>
</ul>
</li>
</ul>
</li>
<li>Make it <span class="caps">EASY</span>
<ul>
<li>On the internet, it’s <span class="caps">EASY</span> for a user to go somewhere else.</li>
<li>Make the site <span class="caps">EASY TO USE</span>, or they will leave, and go to a competitor whose site <strong>IS</strong> easy to use
<ul>
<li>Don’t assume that they will stay because of your <span class="caps">BRAND</span>, or because of your <span class="caps">MONOPOLY</span>.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/focus-on-the-user/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making a Great Place for Developers to Work</title>
		<link>http://www.brightmix.com/blog/making-a-great-place-for-developers-to-work/</link>
		<comments>http://www.brightmix.com/blog/making-a-great-place-for-developers-to-work/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 03:14:00 +0000</pubDate>
		<dc:creator>Dusty</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[benefits]]></category>
		<category><![CDATA[cool office]]></category>
		<category><![CDATA[cubicles]]></category>
		<category><![CDATA[employees]]></category>
		<category><![CDATA[hiring]]></category>
		<category><![CDATA[office]]></category>

		<guid isPermaLink="false">http://www.brightmix.com//2008/02/07/making-a-great-place-for-developers-to-work</guid>
		<description><![CDATA[Kevin and I are frequently asked why we started our own company, and it’s often assumed that we did it to become rich and famous, to have total freedom, to be the boss, or to (insert some other selfish reason). While these benefits were, no doubt, motivational factors, one of our greater reasons involves developer [...]]]></description>
			<content:encoded><![CDATA[<p>Kevin and I are frequently asked why we started our own company, and it’s often assumed that we did it to become rich and famous, to have total freedom, to be the boss, or to (insert some other selfish reason). While these benefits were, no doubt, motivational factors, one of our greater reasons involves developer treatment. That is to say, <span class="highlight">we started BrightMix because we were tired of working for companies that did not treat developers like total rockstars. Period</span>.</p>
<p>You see, we’re deeply committed to <em>many</em> of the <a href="http://www.joelonsoftware.com/articles/HighNotes.html">ideas that Joel Spolsky has set forth</a>. I guess you could say we drank the Koolaid – and liked it.</p>
<blockquote><p>For the last five years I’ve been testing that theory in the real world. The formula for the company I started with Michael Pryor in September, 2000 can be summarized in four steps:</p>
<table style="font-family: Helvetica,Arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; text-align: center;" border="0" align="center">
<tbody>
<tr>
<td style="border: 1px solid black; width: 65px;">Best Working Conditions</td>
<td style="font-size: 200%;">→</td>
<td style="border: 1px solid black; width: 65px;">Best Programmers</td>
<td style="font-size: 200%;">→</td>
<td style="border: 1px solid black; width: 65px;">Best Software</td>
<td style="font-size: 200%;">→</td>
<td style="border: 1px solid black; width: 65px;">Profit!</td>
</tr>
</tbody>
</table>
<p>It’s a pretty convenient formula, especially since our <em>real </em>goal in starting Fog Creek was to create a software company where<em> we would want to work.</em> I made the claim, in those days, that good working conditions (or, awkwardly, “building the company where the best software developers in the world would want to work”) would <em>lead</em> to profits as naturally as chocolate leads to chubbiness or cartoon sex in video games leads to gangland-style shooting sprees.</p></blockquote>
<p>It’s one thing to pay lip service to providing this kind of environment, and as such I think lots of companies would say that they are “developer oriented.” I mean, <em>everyone</em> wants to hire the best-of-the-best, but how many companies actually do what it takes? Kevin and I think that in Omaha, this concept is truly unique. We believe that <span class="highlight">the top developers can choose to work where they want, and we want them to <strong>choose</strong> to work here</span>.</p>
<h2>So, What Do Developers Want?</h2>
<p>Different folks have different desires, but, as developers and previous employees ourselves, we’re pretty clued in on what it takes to keep developers happy… and how far most companies are willing to go to see that happen. Here are some example developer requests we’ve witnessed or made, followed by a typical response from ol’ <span style="color:red;;">Corporation <span class="caps">XYZ</span></span> and then <span style="color:#617703;;">BrightMix’s</span> response.</p>
<p><strong>Developer</strong>: <em>I’d like a comfy chair since I’m sitting for numerous hours every day!</em></p>
<blockquote>
<p style="font-style:normal;padding:0;margin:0;;"><span style="color:red;;"><strong>Corporation <span class="caps">XYZ</span></strong>:</span> No. Then your chair wouldn’t match the rest of the chairs in the office.</p>
<p><span style="color:#617703;;"><strong>BrightMix</strong></span>: Let’s go shopping!</p></blockquote>
<p><strong>Developer</strong>: <em>I’d like dual monitors.</em></p>
<blockquote>
<p style="font-style:normal;padding:0;margin:0;;"><span style="color:red;;"><strong>Corporation <span class="caps">XYZ</span></strong>:</span> Those are only given to managers and people of higher importance.</p>
<p><span style="color:#617703;;"><strong>BrightMix</strong></span>: Dual 24” <span class="caps">LCD</span>’s are standard issue here. Actually, we can probably get you a 3rd.</p></blockquote>
<p><strong>Developer</strong>: <em>Will you buy me this programming book off Amazon?</em></p>
<blockquote>
<p style="font-style:normal;padding:0;margin:0;;"><span style="color:red;;"><strong>Corporation <span class="caps">XYZ</span></strong>:</span> Maybe, and only if it relates to what you’re currently doing. We can put in an order and have it here in 6 months.</p>
<p><span style="color:#617703;;"><strong>BrightMix</strong></span>: Go for it. Here’s the company card.</p></blockquote>
<p><strong>Developer</strong>: <em>Free Lunch, Soda, and Snacks?</em></p>
<blockquote>
<p style="font-style:normal;padding:0;margin:0;;"><span style="color:red;;"><strong>Corporation <span class="caps">XYZ</span></strong>:</span> Egregious!</p>
<p><span style="color:#617703;;"><strong>BrightMix</strong></span>: Have all the snacks and soda you want. We’ll even buy you the types that you like. Also, the company will buy you lunch frequently.</p></blockquote>
<p>See where I’m going here? And really, it’s not just about money or other tangible things, it’s about providing things that the top 1% of developers want and deserve. This will keep them feeling challenged, important, satisfied, and happy. Some examples:</p>
<ul>
<li><em>Want challenging problems to solve?</em> You got it.</li>
</ul>
<ul>
<li><em>Want to create a whiz-bang ajaxy spell-checking thing-a-ma-jig?</em> Go for it.</li>
</ul>
<ul>
<li><em>Want to use the latest and greatest technologies?</em> How ‘bout Ruby on Rails, or <span class="caps">ASP</span>.NET <span class="caps">MVC</span>, or The Next Big Thing?</li>
</ul>
<h2>Office Environment</h2>
<p>On top of all of these things, we’re also trying to foster an environment that’s – <em>gasp</em> – <span class="caps">FUN</span>. We believe its possible to have fun at work; it shouldn’t be a place you <em>dread</em> going, but, rather, <span class="highlight">work should be a place that you <em>want</em> to go</span>. Sure we’ll work hard, but we’ll play hard just the same, and nobody’s working 100 hour weeks (40 hour weeks are the norm). Again, <a href="http://www.joelonsoftware.com/articles/BionicOffice.html">Joel says it best</a>:</p>
<blockquote><p>The office should be a hang out: a pleasant place to spend time. If you’re meeting your friends for dinner after work you should want to meet at the office. As Philip Greenspun bluntly puts it: “Your business success will depend on the extent to which programmers essentially live at your office. For this to be a common choice, your office had better be nicer than the average programmer’s home. There are two ways to achieve this result. One is to hire programmers who live in extremely shabby apartments. The other is to create a nice office.”</p></blockquote>
<p>In this regard, we’re already well on our way. We’ve <a href="http://www.brightmix.com/blog/the-move-in-is-complete">acquired an office space</a> that doesn’t look anything like the typical cubicle farm office building. We like to think it has a warm and cozy feel to it, and we want to outfit it with various fun amenities. There’s already a pool table/ping-pong table, and we’ve got plans for a dartboard and a Nintendo Wii. Of course, we’re also open to suggestions <img src='http://www.brightmix.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Great place to work = Great developers</h2>
<p>Simply put, <span class="highlight">as we look forward at our company’s future success, we realize that greatly relies on us hiring the right people</span>. Thus, we want to have the very best developers around working for us, and in order to find, hire and retain these developers, we’re creating the type of environment that they’re going to love.</p>
<p>In the coming days, as we prepare to hire our first official employee(s), we’ll be posting quite a bit more on our philosophies regarding hiring, benefits, work environments, and all things related.</p>
<p>More to come…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/making-a-great-place-for-developers-to-work/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails hosting &#8211; Slicehost</title>
		<link>http://www.brightmix.com/blog/ruby-on-rails-hosting-slicehost/</link>
		<comments>http://www.brightmix.com/blog/ruby-on-rails-hosting-slicehost/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 06:29:00 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[hosting solution]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[slicehost]]></category>

		<guid isPermaLink="false">http://www.brightmix.com//2008/02/07/ruby-on-rails-hosting-slicehost</guid>
		<description><![CDATA[When we established BrightMix, a few months back, we got this blog/website up and running by throwing a Mephisto install onto Dusty’s already existing Dreamhost account. While working on our blog/website was kind of slow and sluggish, it worked, and It was bootstrapping at its finest…
However, we’re to the point where we need to able [...]]]></description>
			<content:encoded><![CDATA[<p>When we established BrightMix, <a href="http://www.brightmix.com/blog/brightmix-begins">a few months back</a>, we got this blog/website up and running by throwing a <a href="http://mephistoblog.com/">Mephisto</a> install onto Dusty’s already existing <a href="http://dreamhost.com">Dreamhost</a> account. While working on our blog/website was kind of slow and sluggish, it worked, and It was bootstrapping at its finest…</p>
<p>However, we’re to the point where we need to able to host Ajaxy Ruby on Rails applications. Unfortunately, we discovered that while Dreamhost is sufficient at serving up static files, it’s <em>less than ideal</em> at hosting web applications (especially Rails) where responsiveness and performance are paramount. Arg! a troubling issue.</p>
<h2>What’s a software shop to do?</h2>
<p>In our search for an alternate hosting service, <a href="http://www.slicehost.com">Slicehost.com</a> was <a href="http://www.theecotone.com/2007/07/03/10-reasons-i-love-slicehostcom">recommended to us.</a> This company specializes in hosting for developers, Ruby on Rails developers in particular. It all sounded good, so we sign up for 1 year of service.</p>
<h2>Service that Rocks the Casba</h2>
<p>The sign-up process was completely automated and painless. After signing up, I was told that we would have to wait a month for a slice to become available. (They had a shortage of available slices due to demand.) No worries.</p>
<p>A month later, I received an Email indicating that our slice was available and ready for use! At this point, all I had to do was log into their slick dashboard interface, select which linux distro I wanted to use, and click “go.” Minutes later, our slice was up and running with a full <a href="http://www.ubuntu.com">Ubuntu</a> install!</p>
<h2>Awesome Documentation</h2>
<p>Setting up things in linux can be a little tricky since there’s a lot of configuring to be done. Luckily, Slicehost has some really good <a href="http://articles.slicehost.com/">tutorials and documentation</a> to help you get your web server/applications rockin and/or a rollin’ in no time. I was able to get BrightMix.com moved and running on its new host after only a few hours. It was all pretty seamless.</p>
<h2>Long Story Short</h2>
<p>We’re extremely satisfied with Slicehost’s pricing and service. BrightMix.com is now approximately 2 gabillion times faster than it was on Dreamhost. If you’re a developer looking for a high-quality, yet affordable, linux-based host, we highly recommend <a href="http://www.slicehost.com">Slicehost.com</a>. It’s simply gravy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/ruby-on-rails-hosting-slicehost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Please, No More Cubicles</title>
		<link>http://www.brightmix.com/blog/please-no-cubicles/</link>
		<comments>http://www.brightmix.com/blog/please-no-cubicles/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 18:29:00 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Running a Business]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[corporate america]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[work efficiency]]></category>
		<category><![CDATA[work environment]]></category>

		<guid isPermaLink="false">http://www.brightmix.com//2008/02/07/please-no-cubicles</guid>
		<description><![CDATA[
Boo, cubicles!
Simply put, we hate cubicles.
Cubicles suck for jobs that require personal concentration (engineering, accounting, most computer-based jobs, etc.).
As previous software programmers for both large and small companies, we&#8217;ve spent plenty of time in the proverbial dilbert&#8216;esque office environment. They exist everywhere, and it gets old&#8230; really, really fast. Of course, the reasons why cubicles [...]]]></description>
			<content:encoded><![CDATA[<div style="float:right;margin-left:10px;text-align:center;"><img src="http://www.brightmix.com/assets/2007/8/23/officeCubiclesSmaller.jpg" alt="" /></p>
<p><em>Boo, cubicles!</em></div>
<p><span class="highlight">Simply put, we hate cubicles.</span></p>
<p>Cubicles suck for jobs that require personal concentration (engineering, accounting, most computer-based jobs, etc.).</p>
<p>As previous software programmers for both large and small companies, we&#8217;ve spent plenty of time in the proverbial <a href="http://www.dilbert.com">dilbert</a>&#8216;esque office environment. They exist everywhere, and it gets old&#8230; really, really fast. Of course, the reasons why cubicles suck have been repeated and <a href="http://www.escapefromcubiclenation.com/get_a_life_blog/2007/07/if-you-are-stuc.html">enumerated</a> <a href="http://www.paulgraham.com/gh.html">many</a> <a href="http://www.fastcompany.com/magazine/95/open_essay.html?partner=rss">times</a> <a href="http://www.joelonsoftware.com/articles/fog0000000050.html">over</a>.</p>
<h3 style="clear:both;">No door leads to mass interruptions and noise pollution</h3>
<p>Many experienced cubicle inhabitants will tell you they get the most stuff done in the hours <em>outside</em> of 8-5&#8211;when no one else is at the office. It&#8217;s really terrible in some office layouts where the programmers are right next to a whole raft of customer service reps whom are on the phone all day.</p>
<h3>The private office as a badge</h3>
<p>Typically, private offices are relegated to employees of importance or seniority. This is just bogus and unfortunate. Not only does this stink for the <em>lowly employees</em>, but it also reinforces the fact that your organization is built around rank and status. Boo and hiss!</p>
<h3>Who likes dull colors and fluorescent lighting, anyway?</h3>
<p>There are only so many cubes that can border a window (these cubes are also usually treated as badges). The rest of the cubes are stuck in the middle of the office space, sans sunlight. Couple this with the drab, unexciting color of the cube walls, and you have more of a dungeon than a work space. Nothing says workplace efficiency like a dungeon!</p>
<h2>Alternatives to cubicles?</h2>
<p>If you&#8217;re not in a position to alter your current work environment, there is likely little you can do, aside from bitching and wearing headphones. <a href="http://www.joelonsoftware.com/articles/fog0000000332.html">Joel</a> has some suggestions:</p>
<blockquote><p>&#8220;Look for ways to get out of this environment. Take a laptop to the company cafeteria, where there are lots of tables that are empty most of the day (and nobody can find you). Book a conference room for the whole day&#8230; The next time there&#8217;s a crunch on and your manager asks you what you need to Get This Done By Tomorrow, you know what to say. They&#8217;ll find you an office for the day. And pretty soon they&#8217;ll start wondering what they can do to keep that productive thing going year round.</p>
<p>Come into work late and leave late. Those hours after the rest of the company goes home can be the most productive.&#8221;</p></blockquote>
<p>However, if you are in a position of power, we suggest you create as many offices with doors as possible and <span class="highlight">steal some of the solutions that other <a href="http://positivesharing.com/2006/10/10-seeeeeriously-cool-workplaces/">successful companies</a> have come up with</span>.</p>
<div style="text-align:center;"><img src="http://www.brightmix.com/assets/2007/8/23/pixar.jpg" alt="" /></div>
<p><a href="http://pixar.com">Pixar</a>, for instance, has replaced the <em>lowly cubicle</em> with small sheds/huts, which have a door, are insulated from outside noise, and have a high customization factor. How rad is that?!</p>
<h3>What&#8217;s the best set up?</h3>
<p>There&#8217;s no one best set up for all businesses. If you want boring, dull, and lifeless employees, put them in a boring, dull, and lifeless environment (not recommended). However, <span class="highlight">if you want creative, kick-ass employees, then put them in a creative, kick-ass environment. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/please-no-cubicles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fat Free Software Development Team</title>
		<link>http://www.brightmix.com/blog/the-fat-free-software-development-team/</link>
		<comments>http://www.brightmix.com/blog/the-fat-free-software-development-team/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 22:15:00 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[small team]]></category>
		<category><![CDATA[sofware]]></category>

		<guid isPermaLink="false">http://www.brightmix.com//2008/02/04/the-fat-free-software-development-team</guid>
		<description><![CDATA[Scenario:
Project manager Timmy receives another email from his boss. &#8220;We&#8217;ve got the go-ahead for software project &#8216;apples.&#8217; It&#8217;s a big project that will take months to complete with a handful of developers. We need to fatten up the programming staff or we&#8217;ll never finish in time and we&#8217;ll get fired! omg!&#8221;
Timmy, having worked on numerous [...]]]></description>
			<content:encoded><![CDATA[<h2>Scenario:</h2>
<p>Project manager Timmy receives another email from his boss. &#8220;We&#8217;ve got the go-ahead for software project &#8216;apples.&#8217; It&#8217;s a big project that will take months to complete with a handful of developers. We need to fatten up the programming staff or we&#8217;ll never finish in time and we&#8217;ll get fired! omg!&#8221;</p>
<p>Timmy, having worked on numerous software projects, knows that <span class="highlight">getting <em>more bodies</em> probably won&#8217;t help the project get completed faster. In fact, it will probably make things happen far, far slower.</span></p>
<h3>Aye, but where&#8217;s the rub?</h3>
<p>The more people involved in a project, the more communication is required to keep everyone up to snuff on things. Communication has to happen between more programmers, project managers, designers, etc. In the end, more time is spent on talking and going to meetings than coding and getting things done&#8230; productivity drag, anyone? As <a href="http://www.stevemcconnell.com/articles/art06.htm">Steve McConnell</a>, the author of <a href="http://www.amazon.com/Code-Complete-Second-Steve-McConnell/dp/0735619670/ref=pd_bbs_sr_1/104-6252855-7944712?ie=UTF8&amp;s=books&amp;qid=1189572402&amp;sr=8-1">Code Complete</a>, points out:</p>
<blockquote><p>Communication flows more easily on small teams than large teams. If you&#8217;re the only person on a project, communication is simple. The only communication path is between you and the customer. As the number of people on a project increases, however, so does the number of communication paths. It doesn&#8217;t increase additively, as the number of people increases, it increases multiplicatively, proportional to the square of the number of people.</p></blockquote>
<h2>What&#8217;s the solution for our friend, Timmy?</h2>
<p>We suggest keeping the team for project &#8216;apples&#8217; lean and focused. Cut out as much fat as possible. Protect the team from looming productivity killers like staff meetings, status report filings, and support tickets. Oh, and load up the team with a free supply of Mountain Dew! <span class="highlight">A small team of developers, run correctly, will out-perform a large, cumbersome team&#8230; hands down.</span></p>
<p>What if his higher-ups aren&#8217;t down with the small team philosophy? That&#8217;s rough! Timmy could try pointing them at the plethora of <a href="http://gettingreal.37signals.com/ch03_Less_Mass.php">pro</a>-<a href="http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/ref=pd_bbs_sr_1/104-6252855-7944712?ie=UTF8&amp;s=books&amp;qid=1189581750&amp;sr=8-1">small</a>-<a href="http://www.amazon.com/Peopleware-Productive-Projects-Tom-DeMarco/dp/0932633439/ref=pd_bbs_2/104-6252855-7944712?ie=UTF8&amp;s=books&amp;qid=1189581750&amp;sr=8-2">team </a> evidence already out there.</p>
<h3>BrightMix = Lean!</h3>
<p>Dusty and myself have both worked in large development teams and&#8230; well, we don&#8217;t like it. We like the flexibility and low overhead that our lean-ness gives us in the software development process. Honestly, though, this is the subject for another whole blog post!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightmix.com/blog/the-fat-free-software-development-team/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
