<?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>Wagner Danda Weblog &#187; Tips</title>
	<atom:link href="http://www.wagnerdanda.me/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wagnerdanda.me</link>
	<description>.NET, OpenSource, Web 2.0 and other projects</description>
	<lastBuildDate>Fri, 06 Aug 2010 04:28:48 +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>Tip/Trick &#8211; Visual Studio to behave more like Eclipse (productivity boost)</title>
		<link>http://www.wagnerdanda.me/2010/08/visual-studio-tips-like-eclipse/</link>
		<comments>http://www.wagnerdanda.me/2010/08/visual-studio-tips-like-eclipse/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 04:28:48 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[tip/trick]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=198</guid>
		<description><![CDATA[I&#8217;ve been slowly customizing my Visual Studio with a few neat tricks like when I used to work with Eclipse. I recommend these two as a starting point:




Rock Scroll &#8211; Text Highlight with an enhanced scroll bar. Very neat tool to help you visually locate where a variable is used along the code: http://microsoftdev.blogspot.com/2008/05/rock-scroll-visual-studio-plugin.html


Quick Open [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">I&#8217;ve been slowly customizing my Visual Studio with a few neat tricks like when I used to work with Eclipse. I recommend these two as a starting point:</div>
<div></div>
<div id="_mcePaste"></div>
<div></p>
<ul>
<li><a href="http://microsoftdev.blogspot.com/2008/05/rock-scroll-visual-studio-plugin.html">Rock Scroll</a> &#8211; Text Highlight with an enhanced scroll bar. Very neat tool to help you visually locate where a variable is used along the code:<a href="http://microsoftdev.blogspot.com/2008/05/rock-scroll-visual-studio-plugin.html"> http://microsoftdev.blogspot.com/2008/05/rock-scroll-visual-studio-plugin.html</a></li>
</ul>
<ul>
<li><a href="http://kutny.net/vsopen/">Quick Open File</a> &#8211; create a shortcut that you like and voila, you can quickly access any file in your project: <a href="http://kutny.net/vsopen/">http://kutny.net/vsopen/</a></li>
</ul>
</div>
<p>More to come. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2010/08/visual-studio-tips-like-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Ajax Error/Exception Handling &#8211; the simple way</title>
		<link>http://www.wagnerdanda.me/2010/01/asp-net-ajax-updatepanel-error-exception-handling-the-simple-way/</link>
		<comments>http://www.wagnerdanda.me/2010/01/asp-net-ajax-updatepanel-error-exception-handling-the-simple-way/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 01:36:56 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[exception handling]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[UpdatePanel Error Handling]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=134</guid>
		<description><![CDATA[A lot has been said about error/exception handling with ASP.NET Ajax pages, more specifically, how to properly handle and display error messages inside an UpdatePanel. For instance, Scott Gu wrote this sometime ago:
You can now optionally [...] intercept any error message sent back from the server, and perform custom client-side actions as a result [...]. [...]]]></description>
			<content:encoded><![CDATA[<p>A lot has been said about error/exception handling with ASP.NET Ajax pages, more specifically, how to properly handle and display error messages inside an UpdatePanel. For instance, <a href="http://weblogs.asp.net/scottgu/">Scott Gu</a> wrote this sometime ago:</p>
<blockquote><p><em>You can now </em><strong><em>optionally </em></strong><em>[...] intercept any error message sent back from the server, and perform custom client-side actions as a result [...]. (<a href=" http://weblogs.asp.net/scottgu/archive/2006/10/29/tip_2f00_trick_3a00_-handling-errors-with-the-updatepanel-control-using-asp.net-ajax.aspx">source</a></em><em>)</em></p></blockquote>
<p><strong>Well, I disagree with &#8220;optionally&#8221;.</strong> As far as I understand, <strong>if you don&#8217;t explicitly intercept</strong> the error/exception sent back from the server from within an UpdatePanel, your user will get an unfriendly javascript error like this:</p>
<p><a href="http://www.wagnerdanda.me/wp-content/uploads/2010/01/error_on_page1.jpg"><img class="aligncenter size-full wp-image-143" title="asp.net ajax updatepanel error on page message" src="http://www.wagnerdanda.me/wp-content/uploads/2010/01/error_on_page1.jpg" alt="" width="593" height="67" /></a></p>
<p><strong>So what can you do to fix this? </strong>Easy, just add this piece of Javascript code to your Masterpage (or to any page if you don&#8217;t have/use a Masterpage):</p>
<pre class="brush: jscript; highlight: [1,13,19];">
&lt;%-- This script must be placed after the form declaration (i.e. &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;) --%&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    Sys.Application.add_load(AppLoad);

    function AppLoad() {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
    }

    function EndRequest(sender, args) {
        // Check to see if there's an error on this request.
        if (args.get_error() != undefined) {

            var msg = args.get_error().message.replace(&quot;Sys.WebForms.PageRequestManagerServerErrorException: &quot;, &quot;&quot;);

            // Show the custom error.
            // Here you can be creative and do whatever you want
            // with the exception (i.e. call a modalpopup and show
            // a nicer error window). I will simply use 'alert'
            alert(msg);

            // Let the framework know that the error is handled,
            //  so it doesn't throw the JavaScript alert.
            args.set_errorHandled(true);
        }
    }
&lt;/script&gt;
</pre>
<p><strong>Now you should get error messages like this (javascript alert): </strong><a href="http://www.wagnerdanda.me/wp-content/uploads/2010/01/ooops_error.jpg"><img class="aligncenter size-full wp-image-162" title="ooops_error" src="http://www.wagnerdanda.me/wp-content/uploads/2010/01/ooops_error.jpg" alt="" width="306" height="193" /></a></p>
<p>This is exactly how exceptions used to be displayed when thrown inside an UpdatePanel before .NET 3.5.</p>
<p><strong>Note: I do understand the benefits of a the new approach</strong>. It gives you flexibility to present the error message any way you want, before your hands where quite tied to this simple Javascript alert window.</p>
<p>As a matter of fact, I&#8217;ve implemented a nice <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx">ModalPopup</a> and have ensure that only user-friendly messages are actually shown: only messages of a certain type (i.e. UIMessageException) are forwarded to the user without any cleanup/transformation.</p>
<p>References:</p>
<ul>
<li><a href="http://www.jankoatwarpspeed.com/post/2008/06/02/Exception-handling-best-practices-in-ASPNET-web-applications.aspx ">Exception handling best practices in ASP.NET web applications</a></li>
<li><a href="http://www.asp.net/(S(ywiyuluxr3qb2dfva1z5lgeg))/learn/ajax-videos/video-9184.aspx">How Do I: Customize Error Handling for the ASP.NET AJAX UpdatePanel</a></li>
<li>MVP blog: <a href="http://msmvps.com/blogs/luisabreu/archive/2006/10/29/UpdatePanel_3A00_-having-fun-with-errors.aspx">UpdatePanel: having fun with errors</a></li>
<li>MSDN post (be careful, not 100% correct): <a href="http://msdn.microsoft.com/en-us/library/bb398934.aspx">Customizing Error Handling for ASP.NET UpdatePanel Controls</a></li>
</ul>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2010/01/asp-net-ajax-updatepanel-error-exception-handling-the-simple-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tip/Trick: Optimizing ASP.NET Build Time with Dynamic Compilation (optimizeCompilations=&#8221;true&#8221;)</title>
		<link>http://www.wagnerdanda.me/2009/11/optimizing-asp-net-build-time-with-dynamic-compilation-and-optimizecompilations/</link>
		<comments>http://www.wagnerdanda.me/2009/11/optimizing-asp-net-build-time-with-dynamic-compilation-and-optimizecompilations/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 21:50:14 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Dynamic Compilation]]></category>
		<category><![CDATA[optimizeCompilations]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=23</guid>
		<description><![CDATA[If you are experiencing slow builds with ASP.NET projects or want to learn how to speed them up please read on.
Microsoft has introduced a new optimizeCompilations switch in ASP.NET that can greatly improve the compilation speed in some scenarios. You can read this blog post to understand the overall idea, study a more detailed explanation about [...]]]></description>
			<content:encoded><![CDATA[<p><strong>If you are experiencing slow builds with ASP.NET projects or want to learn how to speed them up please read on.</strong></p>
<p>Microsoft has introduced a new optimizeCompilations switch in ASP.NET that can greatly improve the compilation speed in some scenarios. You can read <a href="http://blogs.msdn.com/davidebb/archive/2009/04/15/a-new-flag-to-optimize-asp-net-compilation-behavior.aspx">this</a> blog post to understand the overall idea, study a more detailed explanation about Dynamic Compilation <a href="http://msdn.microsoft.com/en-us/library/ms366723.aspx">here</a> <strong>or</strong> <strong>simply follow these 2 easy steps:</strong></p>
<p><strong>1) Install this hot-fix:</strong></p>
<ul>
<li>Windows XP: <a title="http://code.msdn.microsoft.com/KB969612" href="http://code.msdn.microsoft.com/KB969612/Release/ProjectReleases.aspx?ReleaseId=2582">http://code.msdn.microsoft.com/KB969612</a></li>
<li>Windows Vista: <a href="http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328">http://code.msdn.microsoft.com/KB967535</a></li>
<li>Windows 7 &#8211; not necessary</li>
</ul>
<p><strong>2) Update your web.config as follows:</strong></p>
<p>Add <em>optimizeCompilations=&#8221;true&#8221;</em> to your &lt;<em>compilation</em> &#8230;&gt; tag. Below is an example:</p>
<p><code>&lt;system.web&gt;<br />
....<br />
&lt;compilation debug="true" <strong>optimizeCompilations="true"</strong>&gt;<br />
....<br />
&lt;/compilation&gt;<br />
....<br />
&lt;/system.web&gt;<br />
</code></p>
<p><strong>And you&#8217;re done! </strong>Next time you change something inside the <em>App_code</em> or even a <em>dll</em> inside the <em>bin</em> folder you might not have to wait the entire site to rebuild.</p>
<p><strong>Important note: this approach speeds things up but you might get some weird errors when you start changing some code signatures or restructuring dlls.</strong>In this case, all you need to do is a simple &#8220;rebuild project/solution&#8221; inside your Visual Studio to get things straight again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2009/11/optimizing-asp-net-build-time-with-dynamic-compilation-and-optimizecompilations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
