<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Jeff Paterno's Blog</title>
        <link>http://geekswithblogs.net/jeffpaterno/Default.aspx</link>
        <description> </description>
        <language>en-US</language>
        <copyright>Jeff Paterno</copyright>
        <managingEditor>paterno.jeff@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Jeff Paterno's Blog</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/jeffpaterno/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Configuration Manager Setting Causing Error PRJ0019</title>
            <link>http://geekswithblogs.net/jeffpaterno/archive/2010/04/21/configuration-manager-setting-causing-error-prj0019.aspx</link>
            <description>&lt;p&gt;Recently I ran into an issue with a project failing to build on an automated build server using CruiseControl. When I looked into the build log I saw that the Post-Build project was failing with the error message:&lt;/p&gt;
&lt;p style="margin-left: 40px;"&gt;"error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."&lt;/p&gt;
&lt;p&gt;This was most frustrating especially since the solution was building without issue on my local development environment.&lt;/p&gt;
&lt;p&gt;The Post-Build project was a C++ project that basically called several batch files to unregister/register assemblies, copy resources and supporting files, and place other dependencies in the GAC. I decided to run each of the batch files manually to see if that would provide more information as to why this project was failing. This lead me to determine that the batch file that was placing assemblies in the GAC was the culprit and that it was failing to find a particular assembly. The missing assembly was the output of another project.&lt;/p&gt;
&lt;p&gt;The project that was not producing the expected output was another C++ project that called a batch file. This batch process was actually embedding resource files into an assembly and then copying the assembly to the expected location. The real confusion started when I looked back into my Subversion log and noted that nothing had changed in this project in more than 2 months! It was almost as if the project had stopped building altogether. But what would cause that?! The Configuration Manager, obviously!&lt;/p&gt;
&lt;p&gt;Checking the solution's Configuration Manager settings, I found that the project that was not producing any output was in fact not selected to be part of the build process when the "Any CPU" platform was selected. This was the problem! I had recently updated the CruiseControl configurations to force the solution to be built targeting the platform "Any CPU". As a result, the project that was at the root of the problem was not configured to be built and the post-build process was failing when it couldn't find what it needed.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/jeffpaterno/aggbug/139420.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Paterno</dc:creator>
            <guid>http://geekswithblogs.net/jeffpaterno/archive/2010/04/21/configuration-manager-setting-causing-error-prj0019.aspx</guid>
            <pubDate>Wed, 21 Apr 2010 15:47:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jeffpaterno/comments/139420.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jeffpaterno/archive/2010/04/21/configuration-manager-setting-causing-error-prj0019.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jeffpaterno/comments/commentRss/139420.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Searching for Files Using the Visual Studio 2008 Command Prompt</title>
            <link>http://geekswithblogs.net/jeffpaterno/archive/2010/02/04/searching-for-files-using-the-visual-studio-2008-command-prompt.aspx</link>
            <description>&lt;p&gt;I just ran into a scenario where I couldn't find a file in it's expected directory.&lt;/p&gt;
&lt;p&gt;I took the next logical step and ran a typical search using Windows Explorer. Unfortunately this search turned up no results.&lt;/p&gt;
&lt;p&gt;I then found out about the &lt;em&gt;&lt;strong&gt;WHERE &lt;/strong&gt;&lt;/em&gt;utility in the &lt;strong&gt;Visual Studio 2008 Command Prompt&lt;/strong&gt;. Using this utility I was able to display all possible locations of the file on my machine based on a search pattern.&lt;/p&gt;
&lt;p&gt;Here's what you do:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Start -&amp;gt; Programs -&amp;gt; Microsoft Visual Studio 2008 -&amp;gt; Visual Studio Tools -&amp;gt; Visual Studio 2008 Command Prompt&lt;/li&gt;
    &lt;li&gt;Type &lt;strong&gt;where [&lt;em&gt;search pattern for the files to match&lt;/em&gt;]&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/jeffpaterno/aggbug/137800.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Paterno</dc:creator>
            <guid>http://geekswithblogs.net/jeffpaterno/archive/2010/02/04/searching-for-files-using-the-visual-studio-2008-command-prompt.aspx</guid>
            <pubDate>Thu, 04 Feb 2010 19:35:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jeffpaterno/comments/137800.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jeffpaterno/archive/2010/02/04/searching-for-files-using-the-visual-studio-2008-command-prompt.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/jeffpaterno/comments/commentRss/137800.aspx</wfw:commentRss>
        </item>
        <item>
            <title>jQuery - Rotating Ad Functionality</title>
            <link>http://geekswithblogs.net/jeffpaterno/archive/2009/04/02/jquery---rotating-ad-functionality.aspx</link>
            <description>&lt;span style="font-family: Comic Sans MS;"&gt;Recently I was working on a project where the need for rotating ad functionality was needed. The site used Ektron and one of the content blocks was required to rotate between three different pieces of content.&lt;/span&gt;&lt;br style="font-family: Comic Sans MS;" /&gt;
&lt;br style="font-family: Comic Sans MS;" /&gt;
&lt;span style="font-family: Comic Sans MS;"&gt;The first go at this resulted in an implementation that used the &lt;/span&gt;&lt;a style="font-family: Comic Sans MS;" href="javascript:void(0);/*1238689793338*/"&gt;MooTools&lt;/a&gt;&lt;span style="font-family: Comic Sans MS;"&gt; javascript framework. This implementation achieved the desired functionality, with the different pieces of content rotating between each other. However, this implementation also resulted in a feature (&lt;/span&gt;&lt;span style="font-style: italic; font-family: Comic Sans MS;"&gt;as we developers like to call them&lt;/span&gt;&lt;span style="font-family: Comic Sans MS;"&gt;). The Ektron menu items were now generating javascript errors (such as "&lt;span style="font-weight: bold;"&gt;menu[thisM][0] is undefined&lt;/span&gt;" or "&lt;span style="font-weight: bold;"&gt;nextMenu is undefined&lt;/span&gt;"). These javascript errors were being from the &lt;span style="font-weight: bold;"&gt;WorkArea/java/pop_core.js&lt;/span&gt; file.&lt;/span&gt;&lt;br style="font-family: Comic Sans MS;" /&gt;
&lt;br style="font-family: Comic Sans MS;" /&gt;
&lt;span style="font-family: Comic Sans MS;"&gt;After some research I found that Ektron was using &lt;a href="javascript:void(0);/*1238691004843*/"&gt;jQuery&lt;/a&gt;, not MooTools, for it's javascript. So I thought to myself, "&lt;span style="font-style: italic;"&gt;Why not stay consistent?&lt;/span&gt;". I decided to implement the rotating ad functionality using jQuery to see if I could get rid of those javascript errors being generated by the Ektron menus.&lt;/span&gt;&lt;br style="font-family: Comic Sans MS;" /&gt;
&lt;br style="font-family: Comic Sans MS;" /&gt;
&lt;span style="font-family: Comic Sans MS;"&gt;Using one of the tutorials on &lt;/span&gt;&lt;span style="font-family: Comic Sans MS;"&gt;jQuery&lt;/span&gt;&lt;span style="font-family: Comic Sans MS;"&gt;'s site (&lt;/span&gt;&lt;a style="font-family: Comic Sans MS;" href="javascript:void(0);/*1238690402837*/"&gt;Tutorials: Scroll Up Headline Reader&lt;/a&gt;&lt;span style="font-family: Comic Sans MS;"&gt;) as a starting point, I implemented the rotating ad functionality with the following source:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="border: 1px solid rgb(0, 0, 0); padding: 5px; margin-left: 20px; margin-right: 20px;"&gt;&lt;font size="1"&gt;&lt;span style="font-family: Courier New;"&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;     &amp;lt;head&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;title&amp;gt;jQuery Rotating Ad&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;style type="text/css"&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             #slideshowoutershell&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 height: 200px;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 position: relative;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 width: 415px;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             }&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             &lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             .slideshow-item &lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 height: 200px;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 overflow: hidden;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 position: absolute;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 top: 0;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 width: 415px;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             }&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;/style&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             var interval_time = 4000; // 3 seconds between changes&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             var item_count;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             var item_interval;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             var old_item = 0;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             var current_item = 0;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             $(document).ready(function() {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 item_count = $("div.slideshow-item").size();&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 $("div.slideshow-item").each(function(i) {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                     $(this).hide();&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 });&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 $("div.slideshow-item:eq(" + current_item + ")").fadeIn("slow");&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 item_interval = setInterval(item_rotate, interval_time); // time in milliseconds&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 $('#slideshow-container').hover(function() {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                     clearInterval(item_interval);&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 }, function() {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                     item_interval = setInterval(item_rotate, interval_time); //time in milliseconds&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                     item_rotate();&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 });&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             });&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             function item_rotate() {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 current_item = (old_item + 1) % item_count;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 $("div.slideshow-item:eq(" + old_item + ")").fadeOut("slow", function() {&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                     $("div.slideshow-item:eq(" + current_item + ")").fadeIn("slow");&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 });&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 old_item = current_item;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             }&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;     &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;     &amp;lt;body&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;h3&amp;gt;Testing of Rotating Ad with jQuery&amp;lt;/h3&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;div id="slideshowoutershell"&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             &amp;lt;div id="slideshow-container"&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 &amp;lt;div id="item-0" class="slideshow-item" style="background-color: Red;"&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 &amp;lt;div id="item-1" class="slideshow-item" style="background-color: Green;"&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;                 &amp;lt;div id="item-2" class="slideshow-item" style="background-color: Blue;"&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;             &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;         &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;     &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt; &amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/font&gt;                                                                 &lt;br /&gt;
&lt;span style="font-family: Courier New;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Courier New;"&gt;&lt;br /&gt;
&lt;span style="font-family: Comic Sans MS;"&gt;After implementing the rotating ad functionality using jQuery, the javascript errors that were being generated by the Ektron menus were resolved and did not occur anymore. For some reason, MooTools was not playing 100% nicely with Ektron. I would be interested if anyone else was able to avoid such javascript errors using Ektron and MooTools together.&lt;/span&gt;&lt;/span&gt; &lt;img src="http://geekswithblogs.net/jeffpaterno/aggbug/130682.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Paterno</dc:creator>
            <guid>http://geekswithblogs.net/jeffpaterno/archive/2009/04/02/jquery---rotating-ad-functionality.aspx</guid>
            <pubDate>Thu, 02 Apr 2009 17:50:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jeffpaterno/comments/130682.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jeffpaterno/archive/2009/04/02/jquery---rotating-ad-functionality.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/jeffpaterno/comments/commentRss/130682.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Rendering a Control as a String</title>
            <link>http://geekswithblogs.net/jeffpaterno/archive/2008/12/18/rendering-a-control-as-a-string.aspx</link>
            <description>Have you ever run across a situation where it would be nice to render an ASP.NET control as a string? For example, let's say that you had to dynamically generate a control at runtime and then embed it's HTML within a &amp;lt;div&amp;gt;. Fortunately, all ASP.NET controls expose the &lt;span style="font-weight: bold;"&gt;RenderControl&lt;/span&gt;() method. Don't get too excited just yet, the &lt;span style="font-weight: bold;"&gt;RenderControl&lt;/span&gt;() method doesn't simply return a string. Instead, the &lt;span style="font-weight: bold;"&gt;RenderControl&lt;/span&gt;() method takes an &lt;span style="font-weight: bold;"&gt;HtmlTextWriter &lt;/span&gt;as input and renders the control into it. Not so fast though, we can't just create an &lt;span style="font-weight: bold;"&gt;HtmlTextWriter &lt;/span&gt;object without first having a &lt;span style="font-weight: bold;"&gt;TextWriter &lt;/span&gt;object. So it boils down to a couple of steps, but rendering an ASP.NET control as a string can be accomplished in the following way:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public string &lt;/span&gt;RenderControlAsString(&lt;span style="color: rgb(0, 128, 128);"&gt;Control &lt;/span&gt;myCtrl)&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;{&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;// Create a StringBuilder to generate the string&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;StringBuilder &lt;/span&gt;sb = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;StringBuilder&lt;/span&gt;();&lt;br /&gt;
&lt;/div&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using &lt;/span&gt;(&lt;span style="color: rgb(0, 128, 128);"&gt;StringWriter &lt;/span&gt;sw = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;StringWriter&lt;/span&gt;(sb))&lt;br /&gt;
&lt;/div&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;{&lt;br /&gt;
&lt;/div&gt;
&lt;div style="margin-left: 80px; font-family: Courier New;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using &lt;/span&gt;(&lt;span style="color: rgb(0, 128, 128);"&gt;HtmlTextWriter &lt;/span&gt;tw = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;HtmlTextWriter&lt;/span&gt;(sw))&lt;br /&gt;
{&lt;br /&gt;
&lt;div style="margin-left: 40px;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;// Render the control&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-left: 40px;"&gt;myCtrl.RenderControl(tw);&lt;/div&gt;
}&lt;/div&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;}&lt;br /&gt;
&lt;span style="color: rgb(0, 153, 0);"&gt;// Return the control rendered as a string&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;return &lt;/span&gt;sb.ToString();&lt;br /&gt;
&lt;/div&gt;
&lt;span style="font-family: Courier New;"&gt;}&lt;/span&gt; &lt;img src="http://geekswithblogs.net/jeffpaterno/aggbug/128023.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Paterno</dc:creator>
            <guid>http://geekswithblogs.net/jeffpaterno/archive/2008/12/18/rendering-a-control-as-a-string.aspx</guid>
            <pubDate>Thu, 18 Dec 2008 15:05:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jeffpaterno/comments/128023.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jeffpaterno/archive/2008/12/18/rendering-a-control-as-a-string.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/jeffpaterno/comments/commentRss/128023.aspx</wfw:commentRss>
        </item>
        <item>
            <title>My Favorite Visual Studio Tips</title>
            <link>http://geekswithblogs.net/jeffpaterno/archive/2008/12/05/my-favorite-visual-studio-tips.aspx</link>
            <description>&lt;h2&gt;1. Ctrl+Shift+V&lt;br /&gt;
&lt;/h2&gt;
&lt;span style="font-weight: bold; font-style: italic;"&gt;Ctrl+Shift+V&lt;/span&gt; will cycle through the items in the clipboard ring. This allows you to copy multiple things before even attempting to paste them and then paste them in order at a later point. Keep in mind that the clipboard ring holds up to 20 items.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;2. Line Numbers&lt;/h2&gt;
Line numbers make it much easier to discuss your code with someone else, especially during code reviews or technical demos.&lt;br /&gt;
&lt;br /&gt;
To add line numbers to your code&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Click &lt;span style="font-weight: bold; font-style: italic;"&gt;Tools &lt;/span&gt;menu and select &lt;span style="font-weight: bold; font-style: italic;"&gt;Options...&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;
    &lt;/span&gt;&lt;img src="file:///C:/DOCUME~1/jpaterno/LOCALS~1/Temp/moz-screenshot-1.jpg" alt="" /&gt;&lt;img src="file:///C:/DOCUME~1/jpaterno/LOCALS~1/Temp/moz-screenshot-4.jpg" alt="" /&gt;&lt;/li&gt;
    &lt;li&gt;Expand the &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;Text Editor&lt;/span&gt; &lt;/span&gt;tree item&lt;/li&gt;
    &lt;li&gt;Select the &lt;span style="font-weight: bold; font-style: italic;"&gt;C#&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;(or &lt;span style="font-weight: bold; font-style: italic;"&gt;Basic&lt;/span&gt;) tree item&lt;/li&gt;
    &lt;li&gt;In the &lt;span style="font-style: italic; font-weight: bold;"&gt;Display &lt;/span&gt;section, check &lt;span style="font-weight: bold; font-style: italic;"&gt;Line numbers&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="font-style: italic;"&gt;NOTE: The line numbers will be displayed on the left of the text editor.&lt;br /&gt;
&lt;/span&gt;
&lt;h2&gt;3. Snippets&lt;/h2&gt;
Visual Studio has code snippets built in or you can create your own. You can also drag-and-drop sections of code to the Toolbar and use them as snippets.&lt;br /&gt;
&lt;h2&gt;4. Tab Groups&lt;/h2&gt;
If you need to work with multiple windows you can group them together using tab groups. Right-click on the window tab and select &lt;span style="font-style: italic; font-weight: bold;"&gt;New Horizontal Tab Group&lt;/span&gt; (or &lt;span style="font-style: italic; font-weight: bold;"&gt;New Vertical Tab Group&lt;/span&gt;). You can then drag-and-drop other windows to the tab group to add or remove them.&lt;br /&gt;
&lt;h2&gt;5. Regions&lt;/h2&gt;
Regions allow you to organize your code in a clean and concise manner. I am a firm believer in the practice of only pulling logic into a method if it will be used more than once. I accomplish this using regions to group sections of code that are related and act like a function but are only executed once. I also use regions to group sections of my objects together (i.e. Fields, Properties, Methods).&lt;br /&gt;
&lt;br /&gt;
To place code within a region, simple place the&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt; #region &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;a&lt;span style="font-style: italic; font-weight: bold; font-family: Courier New;"&gt;&lt;/span&gt;nd &lt;span style="font-weight: bold; font-style: italic;"&gt;#endregion&lt;/span&gt; tags around the code. For example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New;"&gt;public void Foo()&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;{&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;#region My Region&lt;br /&gt;
&lt;/div&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;// Add code here...&lt;br /&gt;
&lt;/div&gt;
&lt;br style="font-family: Courier New;" /&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;#endregion&lt;br /&gt;
&lt;/div&gt;
&lt;span style="font-family: Courier New;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This would allow the method Foo to be collapsed to look like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New;"&gt;public void Foo()&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;span style="font-family: Courier New;"&gt;{&lt;/span&gt;&lt;br style="font-family: Courier New;" /&gt;
&lt;div style="margin-left: 40px; font-family: Courier New;"&gt;
&lt;table cellspacing="0" cellpadding="0" border="1" align="" style="width: 65px; height: 19px; font-family: Courier New;" summary=""&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;My Region&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;span style="font-family: Courier New;"&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;
&lt;h2&gt;6. Auto-complete (Ctrl+Space)&lt;br /&gt;
&lt;/h2&gt;
Talk about a time saver! I think once I discovered &lt;span style="font-style: italic; font-weight: bold;"&gt;Ctrl+Space&lt;/span&gt; I was unable to type a full word again. Even better, intellisense will display suggestions if there is more than one possibility with what you have already typed. &lt;img src="http://geekswithblogs.net/jeffpaterno/aggbug/127602.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Paterno</dc:creator>
            <guid>http://geekswithblogs.net/jeffpaterno/archive/2008/12/05/my-favorite-visual-studio-tips.aspx</guid>
            <pubDate>Fri, 05 Dec 2008 19:26:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/jeffpaterno/comments/127602.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/jeffpaterno/archive/2008/12/05/my-favorite-visual-studio-tips.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/jeffpaterno/comments/commentRss/127602.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
