<?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/"
	>

<channel>
	<title>Adam.Kahtava.com / AdamDotCom &#187; .NET</title>
	<atom:link href="http://adam.kahtava.com/journal/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://adam.kahtava.com/journal</link>
	<description>A software development blog</description>
	<pubDate>Fri, 12 Mar 2010 03:41:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Memcached On PowerShell</title>
		<link>http://adam.kahtava.com/journal/2010/03/09/memcached-on-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2010/03/09/memcached-on-powershell/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:00:44 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2383</guid>
		<description><![CDATA[Memcached has been around for a while, but it's still pretty neat. 
Experiencing a bottleneck with your Object Relational Mappers, Services, Middleware, Database, or whatever? Then Memcached it!
Memcached was intially developed for LiveJournal by Danga Interactive in 2003, and is used by many large sites (YouTube, Amazon, Twitter, to name a few). Today, you can [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://memcached.org/">Memcached</a> has been around for a while, but it's still pretty neat. </p>
<p><em>Experiencing a bottleneck with your Object Relational Mappers, Services, Middleware, Database, or whatever? Then Memcached it!</em></p>
<p>Memcached was intially developed for LiveJournal by Danga Interactive in 2003, and is used by many large sites (YouTube, Amazon, Twitter, to name a few). Today, you can find a Memcached library for all your favourite languages (<a href="http://code.google.com/p/memcached/wiki/Clients">here's the list</a>).</p>
<p>Now; cache testing is tough period, and testing Memcached (which is accessed through a <a href="http://lzone.de/articles/memcached.htm">telnet</a> client) is even more difficult - it's fair to mention that there are a large number of wrappers for Memcached outside the .NET world, but I couldn't find one for that met my needs. </p>
<p>So... I wrote my own. :)</p>
<h3>Introducing Memcached on Powershell</h3>
<p><strong>Sample usage and output</strong></p>
<p>Loading the script (source can be found <a href="http://github.com/AdamDotCom/memcached-on-powershell/raw/master/memcached-on-powershell.ps1">here</a>)</p>
<div class="syntax_hilite">
<div id="code-6">
<div class="code">PS C:\&gt; .\memcached-on-powershell.<span style="">ps1</span></div>
</div>
</div>
<p></p>
<p>Checking Memcached stats on an empty instance</p>
<div class="syntax_hilite">
<div id="code-7">
<div class="code">PS C:\&gt; memcached-stats <span style="color:#800000;">127</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">1</span> <span style="color:#800000;">11211</span><br />
Total items in cache:&nbsp; <span style="color:#800000;">0</span><br />
No slabs found</div>
</div>
</div>
<p></p>
<p>Checking Memcached stats after items have been added to the cache</p>
<div class="syntax_hilite">
<div id="code-8">
<div class="code">PS C:\&gt; memcached-stats <span style="color:#800000;">127</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">1</span> <span style="color:#800000;">11211</span><br />
Total items in cache:&nbsp; <span style="color:#800000;">3</span><br />
Stats for Slab:&nbsp; <span style="color:#800000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Key: <span style="color:#CC0000;">'resume-service:resume:adam-kahtava'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Key: <span style="color:#CC0000;">'open-source-service:github:adamdotcom'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Key: <span style="color:#CC0000;">'open-source-service:googlecode:adam.kahtava.com'</span></div>
</div>
</div>
<p></p>
<p>Clearing all Memcached items</p>
<div class="syntax_hilite">
<div id="code-9">
<div class="code">PS C:\&gt; clear-memcached-items <span style="color:#800000;">127</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">1</span> <span style="color:#800000;">11211</span><br />
Total items in cache:&nbsp; <span style="color:#800000;">0</span></div>
</div>
</div>
<p></p>
<p>Checking Memcached stats on a cleared instance</p>
<div class="syntax_hilite">
<div id="code-10">
<div class="code">PS C:\&gt; memcached-stats <span style="color:#800000;">127</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">0</span>.<span style="color:#800000;">1</span> <span style="color:#800000;">11211</span><br />
Total items in cache:&nbsp; <span style="color:#800000;">0</span><br />
Stats for Slab:&nbsp; <span style="color:#800000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Empty</div>
</div>
</div>
<p></p>
<p>If your test obsessed then you might be interested in the Memcached <a href="http://github.com/memcached/memcached/tree/master/t/">tests</a>.</p>
<p>As always feel free to contribute, view, or download the source <a href="http://github.com/AdamDotCom/memcached-on-powershell">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2010/03/09/memcached-on-powershell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing my Open Source Projects Service: Grab Your Project Details From GitHub or Google Code</title>
		<link>http://adam.kahtava.com/journal/2010/02/11/introducing-my-open-source-projects-service-grab-your-project-details-from-github-or-google-code/</link>
		<comments>http://adam.kahtava.com/journal/2010/02/11/introducing-my-open-source-projects-service-grab-your-project-details-from-github-or-google-code/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 16:00:55 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ADC Services]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[RESTful]]></category>

		<category><![CDATA[Services]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2278</guid>
		<description><![CDATA[Say hello to the newest member of my service family; the Open Source Project Service. This service lets me (and you too my friends) grab our project details from either Google Code, or GitHub.
How it works
If you have a project on GitHub or Google Code, you can retrieve your project details.
Single project host retrieval URI:
http://adam.kahtava.com/services/open-source/projects/{project-host}.{xml&#124;json}?user={username}
Multiple [...]]]></description>
			<content:encoded><![CDATA[<p>Say <em>hello</em> to the newest member of <a href="http://adam.kahtava.com/journal/category/open-source/adc-services/">my service family</a>; <em>the Open Source Project Service</em>. This service lets me (and you too my friends) grab our project details from either <a href="http://code.google.com/u/adam.kahtava.com/">Google Code</a>, or <a href="http://github.com/AdamDotCom">GitHub</a>.</p>
<h3>How it works</h3>
<p>If you have a project on GitHub or Google Code, you can retrieve your project details.</p>
<p>Single project host retrieval URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/open-source/projects/<em>{project-host}</em>.<em>{xml|json}</em>?user=<em>{username}</em></span></p>
<p>Multiple project host retrieval URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/open-source/projects.<em>{xml|json}</em>?project-host:username=<em>{project-host1:username1,<span style="text-decoration: underline;"><em>project-host2:username2<span style="text-decoration: underline;"><em>}</em></span></em></span></em></span></p>
<p><strong>Example</strong>, requesting projects from Google Code in XML format:</p>
<p style="padding-left: 30px;">Request: <a href="http://adam.kahtava.com/services/open-source/projects/googlecode.xml?user=adam.kahtava.com">http://adam.kahtava.com/services/open-source/projects/googlecode.xml?user=adam.kahtava.com</a></p>
<p style="padding-left: 30px;">Response:</p>
<div class="syntax_hilite">
<div id="xml-14">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Projects</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://adam.kahtava.com/services/open-source"</span> xmlns:<span style="color: #000066;">i</span>=<span style="color: #ff0000;">"http://www.w3.org/2001/XMLSchema-instance"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Project<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>The site source in use on Adam.Kahtava.com / AdamDotCom.com (http://adam.kahtava.com/)<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LastMessage<span style="font-weight: bold; color: black;">&gt;</span></span></span>More code coverage on controllers required!! :)<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LastMessage<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LastModified<span style="font-weight: bold; color: black;">&gt;</span></span></span>2010-02-26<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LastModified<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Name<span style="font-weight: bold; color: black;">&gt;</span></span></span>website<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Name<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://code.google.com/p/adamdotcom-website<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Url<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Project<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; ...<br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Projects<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p>
<strong>Example</strong>, requesting projects from GitHub in JSON format:</p>
<p style="padding-left: 30px;">Request: <a href="http://adam.kahtava.com/services/open-source/projects/github.json?user=adamdotcom">http://adam.kahtava.com/services/open-source/projects/github.json?user=adamdotcom</a></p>
<p style="padding-left: 30px;">Response:</p>
<div class="syntax_hilite">
<div id="javascript-15">
<div class="javascript"><span style="color: #66cc66;">&#91;</span><br />
&nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">"Description"</span>:<span style="color: #3366CC;">"A collection of my etcetera, so forth, and so on. Contains a PowerShell script for Twitter, a programming exercise in Ruby, a programming exercise for Google done in JavaScript."</span>,<br />
&nbsp; &nbsp; <span style="color: #3366CC;">"LastMessage"</span>:<span style="color: #3366CC;">"Bing-bing, changing filenames"</span>,<br />
&nbsp; &nbsp; <span style="color: #3366CC;">"LastModified"</span>:<span style="color: #3366CC;">"2009-06-08"</span>,<br />
&nbsp; &nbsp; <span style="color: #3366CC;">"Name"</span>:<span style="color: #3366CC;">"scripts"</span>,<br />
&nbsp; &nbsp; <span style="color: #3366CC;">"Url"</span>:<span style="color: #3366CC;">"http:<span style="color: #000099; font-weight: bold;">\/</span><span style="color: #000099; font-weight: bold;">\/</span>github.com<span style="color: #000099; font-weight: bold;">\/</span>AdamDotCom<span style="color: #000099; font-weight: bold;">\/</span>scripts"</span><br />
&nbsp; <span style="color: #66cc66;">&#125;</span>,<br />
&nbsp; ...<br />
<span style="color: #66cc66;">&#93;</span></div>
</div>
</div>
<p>
<strong>Example</strong>, requesting projects from both GitHub and Google Code in a single request in XML form:</p>
<p>Request:Â <a href="http://adam.kahtava.com/services/open-source/projects.xml?project-host:username=github:adamdotcom,googlecode:adam.kahtava.com">http://adam.kahtava.com/services/open-source/projects.xml?project-host:username=github:adamdotcom,googlecode:adam.kahtava.com</a></p>
<p>Response:</p>
<div class="syntax_hilite">
<div id="xml-16">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Projects</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://adam.kahtava.com/services/open-source"</span> xmlns:<span style="color: #000066;">i</span>=<span style="color: #ff0000;">"http://www.w3.org/2001/XMLSchema-instance"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Project<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Displays your public source code repositories from Google Code and GitHub.<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LastMessage<span style="font-weight: bold; color: black;">&gt;</span></span></span>Added http://code.google.com/p/adamdotcom-services/ link<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LastMessage<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LastModified<span style="font-weight: bold; color: black;">&gt;</span></span></span>2010-02-23<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LastModified<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Name<span style="font-weight: bold; color: black;">&gt;</span></span></span>project badge<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Name<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://github.com/AdamDotCom/project-badge<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Url<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Project<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; ...<br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Project<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>The site source in use on Adam.Kahtava.com / AdamDotCom.com (http://adam.kahtava.com/)<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LastMessage<span style="font-weight: bold; color: black;">&gt;</span></span></span>More code coverage on controllers required!! :)<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LastMessage<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LastModified<span style="font-weight: bold; color: black;">&gt;</span></span></span>2010-02-26<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LastModified<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Name<span style="font-weight: bold; color: black;">&gt;</span></span></span>website<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Name<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://code.google.com/p/adamdotcom-website<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Url<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Project<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; ...<br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Projects<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<h3>And Now What?</h3>
<p>View my sidebar widget that uses this service to display the latest updates from my source code repositories <a href="http://adam.kahtava.com/journal/2010/02/24/the-project-badge-show-the-world-your-github-and-google-code-projects-on-your-blog/">here</a>. </p>
<p>Contribute, view, or download this openly available source code <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk#trunk/AdamDotCom.OpenSource.Service/Source/Service">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2010/02/11/introducing-my-open-source-projects-service-grab-your-project-details-from-github-or-google-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sending Email With Attachments In PowerShell</title>
		<link>http://adam.kahtava.com/journal/2010/01/19/sending-email-with-attachments-in-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2010/01/19/sending-email-with-attachments-in-powershell/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 16:00:22 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2225</guid>
		<description><![CDATA[Here's an example on how to send email with attachments via PowerShell:


# A Mailer script that makes use of System.Net to send email with attachments
#
# Sample usage:
#&#160; PS C:\&#62; Send-Mail-With-Attachment 'email@domain.com' 'Hello world!' 'Filename.txt'
function global:Send-Mail-With-Attachment&#40;$to, $subject, $file&#41;&#123;
&#160; $filenameAndPath = &#40;Resolve-Path .\$file&#41;.ToString&#40;&#41;
&#160; $from = 'Automated Powershell Mailer'
&#160; &#91;void&#93;&#91;Reflection.Assembly&#93;::LoadWithPartialName&#40;'System.Net'&#41; &#124; out-null
&#160; $message = New-Object System.Net.Mail.MailMessage&#40;$from, $to, $subject, [...]]]></description>
			<content:encoded><![CDATA[<p>Here's an example on how to send email with attachments via PowerShell:</p>
<div class="syntax_hilite">
<div id="csharp-18">
<div class="csharp"><span style="color: #008080;"># A Mailer script that makes use of System.Net to send email with attachments</span><br />
<span style="color: #008080;">#</span><br />
<span style="color: #008080;"># Sample usage:</span><br />
<span style="color: #008080;">#&nbsp; PS C:\&gt; Send-Mail-With-Attachment 'email@domain.com' 'Hello world!' 'Filename.txt'</span></p>
<p>function global:Send-Mail-With-Attachment<span style="color: #000000;">&#40;</span>$to, $subject, $file<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span></p>
<p>&nbsp; $filenameAndPath = <span style="color: #000000;">&#40;</span>Resolve-Path .\$file<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; $from = <span style="color: #808080;">'Automated Powershell Mailer'</span></p>
<p>&nbsp; <span style="color: #000000;">&#91;</span><span style="color: #0600FF;">void</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>Reflection.<span style="color: #0000FF;">Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #0000FF;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">'System.Net'</span><span style="color: #000000;">&#41;</span> | out-<span style="color: #0600FF;">null</span></p>
<p>&nbsp; $message = New-<span style="color: #FF0000;">Object</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Net</span>.<span style="color: #0000FF;">Mail</span>.<span style="color: #0000FF;">MailMessage</span><span style="color: #000000;">&#40;</span>$from, $to, $subject, $subject<span style="color: #000000;">&#41;</span><br />
&nbsp; $attachment = New-<span style="color: #FF0000;">Object</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Net</span>.<span style="color: #0000FF;">Mail</span>.<span style="color: #0000FF;">Attachment</span><span style="color: #000000;">&#40;</span>$filenameAndPath, <span style="color: #808080;">'text/plain'</span><span style="color: #000000;">&#41;</span><br />
&nbsp; $message.<span style="color: #0000FF;">Attachments</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>$attachment<span style="color: #000000;">&#41;</span></p>
<p>&nbsp; $smtpClient = New-<span style="color: #FF0000;">Object</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Net</span>.<span style="color: #0000FF;">Mail</span>.<span style="color: #0000FF;">SmtpClient</span><br />
&nbsp; $smtpClient.<span style="color: #0000FF;">host</span> = <span style="color: #808080;">'mail.domain.com'</span><br />
&nbsp; $smtpClient.<span style="color: #0000FF;">Send</span><span style="color: #000000;">&#40;</span>$message<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Contribute, view, or download the script here: <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Mailer.ps1">Mailer.ps1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2010/01/19/sending-email-with-attachments-in-powershell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hacking Anti Cross-site Request Forgery Tokens (CSRF) With Powershell</title>
		<link>http://adam.kahtava.com/journal/2009/12/16/hacking-an-anti-cross-site-request-forgery-tokens-csrf-with-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2009/12/16/hacking-an-anti-cross-site-request-forgery-tokens-csrf-with-powershell/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 16:00:25 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2149</guid>
		<description><![CDATA[I ported the example of how to hack an Anti CRSF Token protected form - previously shown in my post What Are Anti Cross-site Request Forgery Tokens And What Are They Good For? -Â to PowerShell.
How to hack an Anti CRSF Token from PowerShell


function global:spam-adamdotcom&#40;&#41;&#123;
&#160; # Load the assembly containing WebClientWithCookies and RegexUtilities
&#160; &#91;Reflection.Assembly&#93;::LoadFile&#40;&#40;Resolve-Path "AdamDotCom.WebClientWithCookies.dll"&#41;&#41; &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>I ported the example of how to hack an Anti CRSF Token protected form - previously shown in my post <a href="http://adam.kahtava.com/journal/2009/11/25/what-are-anti-cross-site-request-forgery-tokens-and-what-are-they-good-for/">What Are Anti Cross-site Request Forgery Tokens And What Are They Good For?</a> -Â to PowerShell.</p>
<p><strong>How to hack an Anti CRSF Token from PowerShell</strong></p>
<div class="syntax_hilite">
<div id="csharp-21">
<div class="csharp">function global:spam-adamdotcom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span></p>
<p>&nbsp; <span style="color: #008080;"># Load the assembly containing WebClientWithCookies and RegexUtilities</span><br />
&nbsp; <span style="color: #000000;">&#91;</span>Reflection.<span style="color: #0000FF;">Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #0000FF;">LoadFile</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Resolve-Path <span style="color: #808080;">"AdamDotCom.WebClientWithCookies.dll"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> | out-<span style="color: #0600FF;">null</span><br />
&nbsp; <br />
&nbsp; <span style="color: #008080;"># Load the assembly containing System.Web.HttpUtilitiy</span><br />
&nbsp; <span style="color: #000000;">&#91;</span><span style="color: #0600FF;">void</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>Reflection.<span style="color: #0000FF;">Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #0000FF;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"System.Web"</span><span style="color: #000000;">&#41;</span> | out-<span style="color: #0600FF;">null</span>&nbsp; </p>
<p>&nbsp; <span style="color: #008080;"># create a new instance of the HTTP Web Client that supports cookies</span><br />
&nbsp; $webClient = New-<span style="color: #FF0000;">Object</span> AdamDotCom.<span style="color: #0000FF;">Common</span>.<span style="color: #0000FF;">Service</span>.<span style="color: #0000FF;">Utilities</span>.<span style="color: #0000FF;">WebClientWithCookies</span></p>
<p>&nbsp; <span style="color: #008080;"># download the page that contains the Anti CRSF Token</span><br />
&nbsp; <span style="color: #000000;">&#91;</span><span style="color: #0600FF;">void</span><span style="color: #000000;">&#93;</span> $webClient.<span style="color: #0000FF;">DownloadData</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"http://adam.kahtava.com/contact"</span><span style="color: #000000;">&#41;</span>;</p>
<p>&nbsp; <span style="color: #008080;"># use a regular expression to grab the Anti CRSF Token</span><br />
&nbsp; <span style="color: #008080;">#&nbsp; - this is an MVC site so we're looking for a token named &quot;__RequestVerificationToken_Lw__&quot;</span><br />
&nbsp; $regex = <span style="color: #808080;">"__RequestVerificationToken_Lw__=(?&lt;CRSF_Token&gt;[^;]+)"</span><br />
&nbsp; $match = <span style="color: #000000;">&#91;</span>regex<span style="color: #000000;">&#93;</span>::<span style="color: #0000FF;">matches</span><span style="color: #000000;">&#40;</span>$webClient.<span style="color: #0000FF;">ResponseHeaders</span><span style="color: #000000;">&#91;</span><span style="color: #808080;">"Set-Cookie"</span><span style="color: #000000;">&#93;</span>, $regex<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span><br />
&nbsp; $antiCrsfToken = $match.<span style="color: #0000FF;">Groups</span><span style="color: #000000;">&#91;</span><span style="color: #808080;">"CRSF_Token"</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Captures</span><span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span></p>
<p>&nbsp; write-host <span style="color: #808080;">"`nYour Anti CRSF Token is: "</span> $antiCrsfToken</p>
<p>&nbsp; <span style="color: #008080;"># construct the message including the Anti CSRF Token</span><br />
&nbsp; $message = <span style="color: #808080;">"__RequestVerificationToken="</span> + <span style="color: #000000;">&#91;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">HttpUtility</span><span style="color: #000000;">&#93;</span>::<span style="color: #0000FF;">UrlEncode</span><span style="color: #000000;">&#40;</span>$antiCrsfToken<span style="color: #000000;">&#41;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">"&amp;amp;fromName=Johnathon Fink"</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">"&amp;amp;fromAddress=prancesw@rmcres.com"</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">"&amp;amp;subject=Call for your diploma now"</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">"&amp;amp;body=Is your lack of a degree..."</span></p>
<p>&nbsp; <span style="color: #008080;"># send spam-spam-spam</span><br />
&nbsp; $webClient.<span style="color: #0000FF;">Headers</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"Content-Type"</span>, <span style="color: #808080;">"application/x-www-form-urlencoded"</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; <span style="color: #000000;">&#91;</span><span style="color: #0600FF;">void</span><span style="color: #000000;">&#93;</span> $webClient.<span style="color: #0000FF;">UploadData</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"http://adam.kahtava.com/contact/send"</span>, <span style="color: #808080;">"POST"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>.<span style="color: #0000FF;">Encoding</span><span style="color: #000000;">&#93;</span>::<span style="color: #0000FF;">UTF8</span>.<span style="color: #0000FF;">GetBytes</span><span style="color: #000000;">&#40;</span>$message<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</p>
<p>&nbsp; write-host <span style="color: #808080;">"`nSuccess!!! Your spam has been sent.`n"</span><br />
<span style="color: #000000;">&#125;</span></div>
</div>
</div>
<p>
To run this script:</p>
<ol>
<li>Download theÂ <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Automated-AntiCSRF-Authentication-Script.ps1">script</a></li>
<li>Run PowerShell</li>
<li>Load the script:Â <code><a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Automated-AntiCSRF-Authentication-Script.ps1">.\Automated-AntiCSRF-Authentication-Script.ps1</a></code></li>
<li>Start sending spam-spam-spam:Â <code>PS &gt; spam-adamdotcom</code></li>
</ol>
<p>Here's the output as seen on my machine:</p>
<div class="syntax_hilite">
<div id="code-22">
<div class="code">PS C:\&gt; .\Automated-AntiCSRF-Authentication-Script.<span style="">ps1</span><br />
PS C:\&gt; spam-adamdotcom</p>
<p>Your Anti CRSF Token is:&nbsp; f54ZlHS3L1Xyl65dYd1uYYh90ygNKYmCswXJUnr0GYtgcrJdJILsQ2jyFotzc10L</p>
<p>Success!!! Your spam has been sent.</p></div>
</div>
</div>
<p></p>
<p>This example uses a derivation of the .NET Framework's <a href="http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx">Web Client</a> class but with Cookies enabled, so it depends on the <a href="http://adamdotcom-services.googlecode.com/svn/trunk/AdamDotCom.Common.Service/Final-Assemblies/AdamDotCom.Common.Service.dll">AdamDotCom.Common.Service.dll</a> assembly (browse the source <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk#trunk/AdamDotCom.Common.Service/Source/Common/Utilities">here</a>). This dependency can be automatically resolved by issuing the <code>download-client</code> function that's also found within the PowerShell script.</p>
<p>Contribute, view, or download the openly available script here: <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Automated-AntiCSRF-Authentication-Script.ps1">Automated-AntiCSRF-Authentication-Script.ps1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/12/16/hacking-an-anti-cross-site-request-forgery-tokens-csrf-with-powershell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What Are Anti Cross-site Request Forgery Tokens And What Are They Good For?</title>
		<link>http://adam.kahtava.com/journal/2009/11/25/what-are-anti-cross-site-request-forgery-tokens-and-what-are-they-good-for/</link>
		<comments>http://adam.kahtava.com/journal/2009/11/25/what-are-anti-cross-site-request-forgery-tokens-and-what-are-they-good-for/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 17:00:05 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2030</guid>
		<description><![CDATA[Anti Cross-site Request Forgery Tokens help prevent Cross-site Request ForgeryÂ (CSRF) also known as XSRF - pronounced "sea-surf" - and are usually implemented through a hidden HTML form element that contains a unique ID. This ID is passed along with subsequent requests for data and validated on the server. Anti CSRF Tokens try to ensure the [...]]]></description>
			<content:encoded><![CDATA[<p>Anti Cross-site Request Forgery Tokens help prevent <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">Cross-site Request ForgeryÂ (CSRF)</a> also known as XSRF - pronounced <em>"sea-surf"</em> - and are usually implemented through a hidden HTML form element that contains a unique ID. This ID is passed along with subsequent requests for data and validated on the server. Anti CSRF Tokens try to ensure the identity of the user. They aren't a replacement for <a href="http://en.wikipedia.org/wiki/CAPTCHA">CAPTCHA</a>s and don't prevent robots or <a href="http://en.wikipedia.org/wiki/Web_scraping">web scrapers</a> from manipulating your site - as you'll soon see.</p>
<p><strong>Why use an Anti CRSF Token?</strong></p>
<p>An overly simple example: If I didn't use an Anti Forgery Token on <a href="http://adam.kahtava.com/contact/">my contact page</a> (see the source code: <a href="http://code.google.com/p/adamdotcom-website/source/browse/trunk/Source/Website/App/Views/Contact/Index.aspx">View</a> or <a href="http://code.google.com/p/adamdotcom-website/source/browse/trunk/Source/Website/App/Controllers/ContactController.cs">Controller</a>), a Spammer could POST data directly against my contact form and potentially drown me with spam.</p>
<p>Here's a hypothetical form created by an evil Spammer. This form is hosted on http://spammer.com (not my site):</p>
<pre>&lt;form action="<strong>http://adam.kahtava.com/contact/send</strong>" method="POST"&gt;
  &lt;input name="fromName" type="text" value="Johnathon Fink" /&gt;
  &lt;input name="fromAddress" type="text" value="prancesw@rmcres.com" /&gt;
  &lt;input name="subject" type="text" value="Call for your diploma now" /&gt;
  &lt;textarea name="body"&gt;Is your lack of a degree...&lt;/textarea&gt;
  ...
&lt;/form&gt;</pre>
<p><em>Again, note that the form action contains a reference to my site (even though it is hosted on another site). </em></p>
<p>Now, imagine this was a form prompting a user for their username and password. These credentials could be maliciously stored while the user successfully authenticates and is then redirected to the site they thought they were visiting - the wayÂ <a href="http://en.wikipedia.org/wiki/Phishing">phishing</a> usually works.</p>
<p>After adding an Anti CRSF Token to my contact form, a Spammer can't access my form remotely (at least not without the token). My contact form with it's Anti CRSF Token:</p>
<pre>&lt;form action="/contact/send" method="post" name="contact"&gt;
  &lt;input name="<strong>__RequestVerificationToken</strong>" type="hidden" value="0sAqY1ZKb+Qia4..." /&gt;
  &lt;input name="fromName" ...</pre>
<p><em>Note theÂ presenceÂ of theÂ RequestVerificationToken.</em></p>
<p>Said Spammer, can't abuse my form without including the unique token. Technically speaking the Spammer can still abuse my form, but he now needs to:</p>
<ul>
<li>Request (GET) <a href="http://adam.kahtava.com/contact">my contact form</a></li>
<li>Parse out the Anti CRSF Token</li>
<li>POST their spam into <a href="http://adam.kahtava.com/contact/send">my contact form</a> along with the token</li>
</ul>
<p>This is pretty easy to do if you have an implementation of a HTTP Client library that supports cookies.</p>
<p><strong>How to hack an Anti CRSF Token protected form</strong></p>
<p>Using an extended instance of .NETs Web Client here's how our Spammer could circumvent my Anti CRSF Token.</p>
<p>The Spamming script by that wascaly Spammer:</p>
<pre><strong>// create a new HTTP Web Client that supports cookies</strong>
var webClient = new <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk/AdamDotCom.Common.Service/Source/Common/Utilities/WebClientWithCookies.cs">WebClientWithCookies</a>();

<strong>//download my contact page containing the Anti CRSF Token</strong>
webClient = webClient.DownloadData("http://adam.kahtava.com/contact");

<strong>//parse out the Anti CRSF Token</strong>
var antiCrsfToken = <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk/AdamDotCom.Common.Service/Source/Common/Utilities/Utilities.cs">RegexUtilities</a>.GetTokenString(
                      new Regex("__RequestVerificationToken=(?&lt;CRSF_Token&gt;[^;]+)")
                      .Match(webClient.ResponseHeaders["Set-Cookie"]), "CRSF_Token");

<strong>//now the Spammer can drown me in spam-spam-spam
// by scraping my Anti CRSF Token and posting it into my form</strong>
webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
byte[] response = webClient.UploadData("http://adam.kahtava.com/contact/send", "POST",
                            Encoding.UTF8.GetBytes(
                              "<strong>__RequestVerificationToken</strong>=" + antiCrsfToken +
                              "&amp;fromName=\"Johnathon Fink\"" +
                              "&amp;fromAddress=\"prancesw@rmcres.com\"" +
                              "&amp;subject=\"Call for your diploma now\"" +
                              "&amp;body=\"Is your lack of a degree...\""));</pre>
<p>The Spammer is back at their old tricks sending me more Spam. ARGH!</p>
<p><strong>What's the use of anÂ Anti CRSF Token?</strong></p>
<p>Anti CRSF Tokens help prevent phishing attacks. They aren't meant to prevent spammers or DrÂ Robotnik and his robots (or web scrapers) from running automated scripts against your web application. Keep in mind, that if your site suffers from other <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">XSS</a> vulnerabilities (where the privacy of your cookies or sessions are compromised) then Anti CRSF Tokens don't work at all.</p>
<p>Read more about how Anti CRSF Tokens work here: <a href="http://blog.codeville.net/2008/09/01/prevent-cross-site-request-forgery-csrf-using-aspnet-mvcs-antiforgerytoken-helper/">Prevent Cross-Site Request Forgery (CSRF) using ASP.NET MVCâ€™s AntiForgeryToken() helper</a> or learn more about Cross-Site Request Forgery at:Â <a href="http://www.cgisecurity.com/csrf-faq.html">The Cross-Site Request Forgery (CSRF/XSRF) FAQ</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/11/25/what-are-anti-cross-site-request-forgery-tokens-and-what-are-they-good-for/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How To Fix the: &#8220;Validation of viewstate MAC failed&#8221; Error (ASP.NET MVC)</title>
		<link>http://adam.kahtava.com/journal/2009/11/23/how-to-fix-the-validation-of-viewstate-mac-failed-error-aspnet-mvc/</link>
		<comments>http://adam.kahtava.com/journal/2009/11/23/how-to-fix-the-validation-of-viewstate-mac-failed-error-aspnet-mvc/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 17:00:26 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2011</guid>
		<description><![CDATA[I run my site on a Windows Shared Hosting account, and every time I updated the assemblies on my ASP.NET MVC site I'd be presented with the "Validation of viewstate MAC failed" error.
TheÂ "Validation of viewstate MAC failed" errorÂ onlyÂ occurredÂ when a page contained an HTML form element that made use of MVC'sÂ AntiForgeryToken. The quick fix was to [...]]]></description>
			<content:encoded><![CDATA[<p>I run my site on a Windows Shared Hosting account, and every time I updated the assemblies on my ASP.NET MVC site I'd be presented with the <em>"Validation of viewstate MAC failed"</em> error.</p>
<p>TheÂ <em>"Validation of viewstate MAC failed"</em> errorÂ onlyÂ occurredÂ when a page contained an HTML form element that made use of MVC'sÂ <a href="http://msdn.microsoft.com/en-us/library/dd492767.aspx">AntiForgeryToken</a>. The quick fix was to delete my <code>__RequestVerificationToken</code> cookie, but the error would rear its ugly head the minute I touched myÂ assemblies. The <strong>long term solution</strong> was to add a <a href="http://msdn.microsoft.com/en-us/library/w8h3skw9.aspx">machineKey element</a> to my Web.config file - asking visitors to delete a specific cookies when visiting my site was not a viable option.</p>
<p><strong>How I fixed the </strong><em><strong>"Validation of viewstate MAC failed"</strong></em><strong> error on Shared Hosting:</strong></p>
<ol>
<li>I used the <a href="http://aspnetresources.com/tools/keycreator.aspx">&lt;machineKey&gt; Generator Tool</a> to generate a machine key</li>
<li>I added the machineKey element to my Web.config file</li>
</ol>
<p>My Web.config now looks similar to this:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;machineKey validationKey="..." decryptionKey="..." validation="SHA1" /&gt;</pre>
<p>Anyhow, I hope this post helps anyone else that's encountering this error.</p>
<p>Oh wait, here's the error in itsÂ entiretyÂ for The Google Machine's crawlers:</p>
<blockquote><p><code>Server Error in '/' Application.</code></p>
<p><code>Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that  configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.</code></p>
<p><code>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</code></p>
<p><code> </code><code>Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that  configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/11/23/how-to-fix-the-validation-of-viewstate-mac-failed-error-aspnet-mvc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Site Update: New Resume, Contact, Reviews, and Reading Lists Sections</title>
		<link>http://adam.kahtava.com/journal/2009/11/08/site-update-new-resume-contact-reviews-and-reading-lists-sections/</link>
		<comments>http://adam.kahtava.com/journal/2009/11/08/site-update-new-resume-contact-reviews-and-reading-lists-sections/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 17:00:37 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ADC Services]]></category>

		<category><![CDATA[ADC Website]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Amazon]]></category>

		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=1974</guid>
		<description><![CDATA[This site now sports aÂ Resume,Â Contact Me,Â Reviews, andÂ Reading Lists section.
If you're reading this from an RSS feed, then the changes looks like this:

These new sections make use of the services I created earlier - my resume content is pulled directly from LinkedIn via my Resume service, the Reading Lists and Reviews are being pulled from Amazon [...]]]></description>
			<content:encoded><![CDATA[<p>This site now sports aÂ <a href="http://adam.kahtava.com/resume/curriculum-vitae/software-developer/">Resume</a>,Â <a href="http://adam.kahtava.com/contact-me/">Contact Me</a>,Â <a href="http://adam.kahtava.com/book-reviews/">Reviews</a>, andÂ <a href="http://adam.kahtava.com/reading-lists/recommended-and-wishlist/">Reading Lists</a> section.</p>
<p>If you're reading this from an RSS feed, then the changes looks like this:</p>
<p style="padding-left: 30px;"><img src="http://adam.kahtava.com/journal/images/blog/adamdotcom-navigation-update.png" alt="Navigation changes on my site" width="429" height="112" /></p>
<p>These new sections make use of the services I created earlier - my resume content is pulled directly from LinkedIn via my <a href="http://adam.kahtava.com/journal/2009/09/24/introducing-my-linkedin-resume-service-view-your-resume/">Resume service</a>, the Reading Lists and Reviews are being pulled from Amazon via my <a href="http://adam.kahtava.com/journal/2009/09/15/introducing-my-amazon-web-service-find-your-profile-view-your-wishlist-or-reviews/">Amazon service</a>, andÂ I'm still working on a personalized greeting module which will make use of my <a href="http://adam.kahtava.com/journal/2009/09/30/introducing-my-whois-service-customize-your-site-content-based-on-referrals-location-and-more/">Whois service</a>.</p>
<p>Now, when I update my resume on LinkedIn, add a new item to my Amazon wishlist, or write a new Review on Amazon the content is updated within this site and indexed by the Google.</p>
<p>It took longer than expected to get these new pages up and running - mostly due to a couple false starts. You see, I'mÂ runningÂ this site on Windows shared hosting whichÂ unfortunatelyÂ doesn't give me many options - sure, sure, I could purchase another hosting account, but developers are like freak'nÂ MAcGyverÂ we like working withinÂ ridiculousÂ constraints. It's all about the challenge! Anyways, I first tried using Ruby on Rails on shared hosting (fail), then tried using PHP on Trax (fail), and finally reverted to ASP.NET MVC. While ASP.NET MVC is heads and tails more fun than Web Forms / Classic ASP.NET, theÂ impedanceÂ mismatch between strongly typed objects and web languages (JavaScript, CSS, XHTML) is still annoying. Thankfully the <a href="http://github.com/mvccontrib/MvcContrib">MVC Contrib</a> project solves some of these pains, however it can't solve them all.</p>
<p>My next steps with this site are to: finish the greeting module, update the layout (drop the WordPress theme), and finish a Github / Google Code repo widget (kind of like this <a href="http://drnicwilliams.com/2008/05/03/github-badge-for-your-blog/">one</a>) for the sidebar.</p>
<p>Contribute, view, or download the openly available source code <a href="http://code.google.com/p/adamdotcom-website/source/browse/trunk/#trunk/Source/Website">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/11/08/site-update-new-resume-contact-reviews-and-reading-lists-sections/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing my Whois Service: Customize Your Site Content Based On Referrals, Location, and More</title>
		<link>http://adam.kahtava.com/journal/2009/09/30/introducing-my-whois-service-customize-your-site-content-based-on-referrals-location-and-more/</link>
		<comments>http://adam.kahtava.com/journal/2009/09/30/introducing-my-whois-service-customize-your-site-content-based-on-referrals-location-and-more/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 16:00:31 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ADC Services]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[RESTful]]></category>

		<category><![CDATA[Services]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=1892</guid>
		<description><![CDATA[Services-services-services! Enough already! Today I introduce my Whois and Enhanced Whois Web Service.
The Enhanced Whois web service lets me know where my visitor are geographically located, provides filtering capabilities, and can act on referrals. This will allow me (or you) toÂ personalizeÂ site greetings, hide my email address (or content) based on the visitor, and provide a [...]]]></description>
			<content:encoded><![CDATA[<p>Services-services-services! Enough already! Today I introduce my Whois and Enhanced Whois Web Service.</p>
<p>The Enhanced Whois web service lets me know where my visitor are geographically located, provides filtering capabilities, and can act on referrals. This will allow me (or you) toÂ personalizeÂ site greetings, hide my email address (or content) based on the visitor, and provide a unique personal experience.Â AlternatelyÂ I can use this service as a classicÂ <a href="http://en.wikipedia.org/wiki/WHOIS">Whois</a> service.</p>
<h3>How it works.</h3>
<p>We're not anonymous on the internet and IP addresses are whatÂ uniquelyÂ defines your internetÂ existence. <a href="http://en.wikipedia.org/wiki/WHOIS">Whois</a> services let us determine the registrant of internet resources.</p>
<p>Using my Whois service you can:</p>
<p><strong>View your enhanced whois record.</strong></p>
<p>By the visitor's IP address (your IP) URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/whois/enhanced.<em>{xml|json}</em></span></p>
<p>Example:</p>
<p style="padding-left: 30px;">Request:Â <a href="http://adam.kahtava.com/services/whois/enhanced.xml">http://adam.kahtava.com/services/whois/enhanced.xml</a></p>
<p style="padding-left: 30px;"><a href="http://adam.kahtava.com/services/resume/linkedin/adam-kahtava.xml"></a>Response (using my IP):</p>
<pre style="padding-left: 30px;">&lt;WhoisEnhancedRecord xmlns="http://adam.kahtava.com/services/whois" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;City&gt;Calgary&lt;/City&gt;
  &lt;Country&gt;Canada&lt;/Country&gt;
  &lt;FilterMatches i:nil="true"/&gt;
  &lt;FriendlyMatches i:nil="true"/&gt;
  &lt;IsFilterMatch&gt;false&lt;/IsFilterMatch&gt;
  &lt;IsFriendly&gt;false&lt;/IsFriendly&gt;
  &lt;Organization&gt;Shaw Communications Inc.&lt;/Organization&gt;
  &lt;StateProvince&gt;AB&lt;/StateProvince&gt;
&lt;/WhoisEnhancedRecord&gt;</pre>
<p>By the visitor's IP address specifying a referrer, and a filter URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/whois/enhanced.<em>{xml|json}</em>?filters=</span><span style="text-decoration: underline;"><em>{filters,filters,...}</em></span><span style="text-decoration: underline;">&amp;referrer=</span><span style="text-decoration: underline;"><em>{referrer}</em></span></p>
<p>Example:</p>
<p style="padding-left: 30px;">Request:Â <a href="http://adam.kahtava.com/services/whois/enhanced/xml?query=74.125.127.99&amp;filters=CA&amp;referrer=Twitter">http://adam.kahtava.com/services/whois/enhanced/xml?filters=CA&amp;referrer=Twitter</a></p>
<p style="padding-left: 30px;">Response (from an IP owned by Google, with a filter for California, and a referrer of Twitter specified):</p>
<pre style="padding-left: 30px; ">&lt;WhoisEnhancedRecord xmlns="http://adam.kahtava.com/services/whois" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;City&gt;Mountain View&lt;/City&gt;
  &lt;Country&gt;United states&lt;/Country&gt;
  &lt;FilterMatches&gt;
    &lt;string&gt;StateProvince&lt;/string&gt;
  &lt;/FilterMatches&gt;
  &lt;FriendlyMatches&gt;
    &lt;string&gt;<strong>google</strong>&lt;/string&gt;
    &lt;string&gt;<strong>twitter</strong>&lt;/string&gt;
  &lt;/FriendlyMatches&gt;
  &lt;IsFilterMatch&gt;true&lt;/IsFilterMatch&gt;
  &lt;IsFriendly&gt;true&lt;/IsFriendly&gt;
  &lt;Organization&gt;Google Inc.&lt;/Organization&gt;
  &lt;StateProvince&gt;<strong>CA</strong>&lt;/StateProvince&gt;
&lt;/WhoisEnhancedRecord&gt;</pre>
<p><strong>View your classic Whois record.</strong></p>
<p>By the visitor's IP address (your IP) URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/whois.<em>{xml|json}</em></span></p>
<p>Example:</p>
<p style="padding-left: 30px;">Request:Â <a href="http://adam.kahtava.com/services/whois.xml">http://adam.kahtava.com/services/whois.xml</a></p>
<div style="padding-left: 30px;">Response (using my IP):</div>
<pre style="padding-left: 30px;">&lt;WhoisRecord xmlns="http://adam.kahtava.com/services/whois" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;DomainName&gt;68.146.10.100&lt;/DomainName&gt;
  &lt;RegistryData&gt;
  &lt;AbuseContact&gt; ... &lt;/AbuseContact&gt;
  &lt;AdministrativeContact i:nil="true"/&gt;
  &lt;BillingContact i:nil="true"/&gt;
  &lt;CreatedDate&gt;2002-06-03&lt;/CreatedDate&gt;
  &lt;RawText&gt; ... &lt;/RawText&gt;
  &lt;Registrant&gt;
    &lt;Address&gt;Suite 800630 - 3rd Ave. SW&lt;/Address&gt;
    &lt;City&gt;Calgary&lt;/City&gt;
    &lt;Country&gt;CA&lt;/Country&gt;
    &lt;Name&gt;Shaw Communications Inc.&lt;/Name&gt;
    &lt;PostalCode&gt;T2P-4L4&lt;/PostalCode&gt;
    &lt;StateProv&gt;AB&lt;/StateProv&gt;
  &lt;/Registrant&gt;
  ...
&lt;/WhoisRecord&gt;</pre>
<h3>So... why is this useful?</h3>
<p>This is the first step for this site's personalization - if I know where the user came from, where the user isÂ geographicallyÂ located, and have theÂ capabilitiesÂ to filter their Whois responses, then I can tailor my content to the user. For example: if someone from Google landed on my site I could mention that I'd love to work there and provide my email address and phone number, similarly if someone from Calgary landed on my site I could provide my <a href="http://www.google.com/calendar/embed?src=kahtava.com_3b7tc69opbskf5cqgjflihhqpk@group.calendar.google.com&amp;gsessionid=KwiJcMzxbmfA1s3H-Nfjbg">public calendar of local events</a>. The possibilities are endless.</p>
<p>This service will be wrapped by a JavaScript widget that will take care of theÂ asynchronous serviceÂ polling, but that sounds like another post.</p>
<p>Contribute, view, or download the openly available source codeÂ <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk#trunk/AdamDotCom.Whois.Service/Source/Service">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/09/30/introducing-my-whois-service-customize-your-site-content-based-on-referrals-location-and-more/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing my LinkedIn Resume Service: View Your Resume</title>
		<link>http://adam.kahtava.com/journal/2009/09/24/introducing-my-linkedin-resume-service-view-your-resume/</link>
		<comments>http://adam.kahtava.com/journal/2009/09/24/introducing-my-linkedin-resume-service-view-your-resume/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 16:00:19 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ADC Services]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[RESTful]]></category>

		<category><![CDATA[Services]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=1880</guid>
		<description><![CDATA[In my last post I mentioned that I was creating a couple web services that would hopefully bring together my online portfolio. Today I introduce my LinkedIn Resume Web Service.
How it works.
If you have a resume on LinkedIn and you've addedÂ services@adamdotcom.com as a contact then you can:
View your resume - retrieve your Resume by first [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://adam.kahtava.com/journal/2009/09/15/introducing-my-amazon-web-service-find-your-profile-view-your-wishlist-or-reviews/">last post</a> I mentioned that I was creating a couple web services that would hopefully bring together my online portfolio. Today I introduce my LinkedIn Resume Web Service.</p>
<h3>How it works.</h3>
<p>If you have a resume on <a href="http://www.linkedin.com/profile?viewProfile=&amp;key=9962574">LinkedIn</a> and you've addedÂ <em>services@adamdotcom.com</em> as a contact then you can:</p>
<p><strong>View your resume</strong> - retrieve your Resume by first and last name.</p>
<p>By first and last name URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/resume/linkedin/<em>{firstName-lastName}</em>.<em>{xml|json}</em></span></p>
<p>Example:</p>
<p style="padding-left: 30px;">Request:Â <a href="http://adam.kahtava.com/services/resume/linkedin/adam-kahtava.xml">http://adam.kahtava.com/services/resume/linkedin/adam-kahtava.xml</a></p>
<p style="padding-left: 30px;"><a href="http://adam.kahtava.com/services/resume/linkedin/adam-kahtava.xml"></a>Response:</p>
<pre style="padding-left: 30px;">&lt;Resume xmlns="http://adam.kahtava.com/services/resume" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;Educations&gt;
    &lt;Education&gt;
      &lt;Certificate&gt;Computer Programming and Analysis&lt;/Certificate&gt;
      &lt;Institute&gt;Seneca College of Applied Arts and Technology&lt;/Institute&gt;
    &lt;/Education&gt;
    &lt;Education&gt;
      &lt;Certificate&gt;Bachelor of Science (Honours), Computer Science&lt;/Certificate&gt;
      &lt;Institute&gt;Trent University&lt;/Institute&gt;
    &lt;/Education&gt;
  &lt;/Educations&gt;
  &lt;Positions&gt;
    &lt;Position&gt;
      &lt;Company&gt;Corbis ...</pre>
<h3>Wow that was exciting, so now what?</h3>
<p>Well.. Head on over to my <a href="http://adam.kahtava.com/resume/curriculum-vitae/software-developer/">resume</a> page. My resume is being pulled from LinkedIn through this very service.</p>
<p>Contribute, view, or download the openly available source code <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk#trunk/AdamDotCom.Resume.Service/Source/Service">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/09/24/introducing-my-linkedin-resume-service-view-your-resume/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing my Amazon Web Service: Find Your Profile, View Your Wishlist or Reviews</title>
		<link>http://adam.kahtava.com/journal/2009/09/15/introducing-my-amazon-web-service-find-your-profile-view-your-wishlist-or-reviews/</link>
		<comments>http://adam.kahtava.com/journal/2009/09/15/introducing-my-amazon-web-service-find-your-profile-view-your-wishlist-or-reviews/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 16:00:12 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ADC Services]]></category>

		<category><![CDATA[Amazon]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[RESTful]]></category>

		<category><![CDATA[Services]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=1822</guid>
		<description><![CDATA[
My online portfolio is increasingly scattered through the internet (reviews and wishlist are on Amazon, source code on github / Google Projects, resume on LinkedIn, and so on). I've been working on a couple services that will eventually pull my portfolio together while keeping a single point of reference, and... I'm sharing these services.
Introducing my [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 0px 0px 10px 5px; float: right;"><img src="http://awsmedia.s3.amazonaws.com/logo_aws.gif" alt="" /></div>
<p>My online portfolio is increasingly scattered through the internet (<a href="http://www.amazon.com/gp/cdp/member-reviews/A2JM0EQJELFL69/ref=cm_pdp_rev_all?ie=UTF8&amp;sort_by=MostRecentReview">reviews</a> and <a href="http://www.amazon.com/Adam-Kahtava/wishlist/3JU6ASKNUS7B8/ref=cm_pdp_wish_all_itms">wishlist</a> are on Amazon, source code on <a href="http://github.com/adamdotcom">github</a> / Google Projects, resume on <a href="http://www.linkedin.com/pub/adam-kahtava/3/405/466">LinkedIn</a>, and so on). I've been working on a couple services that will eventually pull my portfolio together while keeping a single point of reference, and... I'm sharing these services.</p>
<p>Introducing my Amazon Web Service.</p>
<h3>How it works.</h3>
<p>Basically if you have a Wishlist or a Review list on Amazon you can:</p>
<p><strong>Discover your profile</strong> - retrieve your ListId (forÂ WishLists)Â or CustomerId (for Reviews):</p>
<p>Discovery URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/amazon/discover/user/</span><em><span style="text-decoration: underline;">{user-name}</span></em><span style="text-decoration: underline;">.</span><em><span style="text-decoration: underline;">{xml|json}</span></em></p>
<p>Example:</p>
<p style="padding-left: 30px; ">Request:Â <a href="http://adam.kahtava.com/services/amazon/discover/user/adam-kahtava.xml">http://adam.kahtava.com/services/amazon/discover/user/adam-kahtava.xml</a></p>
<p style="padding-left: 30px; ">Response:</p>
<pre style="padding-left: 30px; ">&lt;Profile xmlns="http://adam.kahtava.com/services/amazon" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;CustomerId&gt;A2JM0EQJELFL69&lt;/CustomerId&gt;
  &lt;ListId&gt;3JU6ASKNUS7B8&lt;/ListId&gt;
&lt;/Profile&gt;</pre>
<p><strong>View your Reviews -Â <span style="font-weight: normal;">retrieve your Reviews by usernameÂ or Amazon CustomerId.</span></strong></p>
<p>By customerId URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/amazon/reviews/id/<em>{customerId}</em>.<em>{xml|json}</em></span></p>
<p>By username URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/amazon/reviews/user/<em>{user-name}</em>.<em>{xml|json}</em></span></p>
<p>Example:</p>
<p style="padding-left: 30px;">Request: <a href="http://adam.kahtava.com/services/amazon/reviews/id/A2JM0EQJELFL69.xml">http://adam.kahtava.com/services/amazon/reviews/id/A2JM0EQJELFL69.xml</a></p>
<p style="padding-left: 30px;">Response:</p>
<pre style="padding-left: 30px;">&lt;Reviews xmlns="http://adam.kahtava.com/services/amazon" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;Review&gt;
    &lt;ASIN&gt;0321125215&lt;/ASIN&gt;
    &lt;Authors&gt;Eric Evans&lt;/Authors&gt;
    &lt;AuthorsMLA&gt;Evans Eric.&lt;/AuthorsMLA&gt;
    &lt;Content&gt;Through this book Evan's ...</pre>
<p><strong>View your Wishlist -Â <span style="font-weight: normal;">view your Wishlist by username or Amazon ListId.</span></strong></p>
<p>By listId URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/amazon/wishlist/id/<em>{listId}</em>.<em>{xml|json}</em></span></p>
<p>By username URI:</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">http://adam.kahtava.com/services/amazon/wishlist/user/<em>{user-name}</em>.<em>{xml|json}</em></span></p>
<p>Example:</p>
<p style="padding-left: 30px;">Request:Â <a href="http://adam.kahtava.com/services/amazon/wishlist/user/adam-kahtava.json">http://adam.kahtava.com/services/amazon/wishlist/user/adam-kahtava.json</a></p>
<p style="padding-left: 30px;">Response:</p>
<pre style="padding-left: 30px;">[{"ASIN":"0471467413","Authors":"Mostafa Abd-El-Barr, Hesham El-Rewini", ...</pre>
<h3>So now what?</h3>
<p>Head on over to my <a href="http://adam.kahtava.com/book-reviews/">Reviews</a> and <a href="http://adam.kahtava.com/reading-lists/recommended-and-wishlist/">Reading List</a> pages. These pages make use of the data from this service. I should also mention that, this service was built on a previous iteration of my Amazon Web Service (<a href="http://adam.kahtava.com/journal/2008/10/06/how-to-display-your-amazon-reviews-and-wish-list-on-your-site-using-amazons-web-services/">How To Display Your Amazon Reviews and Wish List Using Amazonâ€™s Web Services</a>).</p>
<p>Contribute, view, or download the openly available source code <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk#trunk/AdamDotCom.Amazon.Service/Source/Service">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/09/15/introducing-my-amazon-web-service-find-your-profile-view-your-wishlist-or-reviews/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Don&#8217;t Write Frameworks For Dummies</title>
		<link>http://adam.kahtava.com/journal/2009/02/05/dont-write-frameworks-for-dummies/</link>
		<comments>http://adam.kahtava.com/journal/2009/02/05/dont-write-frameworks-for-dummies/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 23:03:09 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,b1e1660b-3d7e-46e7-a287-6c136b938178.aspx</guid>
		<description><![CDATA[Eric Evans offers this piece of advice:
Don't write frameworks for dummies. [Frameworks designed by organizations] that assume some developers are not smart enough ... are likely to fail because they underestimate the difficulty of ... development. ... This attitude also poisons the relationship between [the developers and framework designer]. - Eric Evans, Domain-Driven Design: Tackling [...]]]></description>
			<content:encoded><![CDATA[<p>Eric Evans offers this piece of advice:</p>
<blockquote><p>Don't write frameworks for dummies. [Frameworks designed by organizations] that assume some developers are not smart enough ... are likely to fail because they underestimate the difficulty of ... development. ... This attitude also poisons the relationship between [the developers and framework designer]. - Eric Evans, <a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215/">Domain-Driven Design: Tackling Complexity in the Heart of Software</a></p></blockquote>
<p>Evans goes on to make the point that there's a fine line between designing for dummies, and providing useful encapsulation / abstraction. I found this advice interesting because I had been wrestling with whether the <a href="http://adam.kahtava.com/journal/2008/04/21/the-aspnet-ajax-framework-is-for-dummies/">ASP.NET AJAX Framework is for Dummies</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/02/05/dont-write-frameworks-for-dummies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MVC is a Welcome Addition to ASP.NET, but&#8230;. MVC Frameworks, like Ruby on Rails are More Mature</title>
		<link>http://adam.kahtava.com/journal/2008/11/26/mvc-is-a-welcome-addition-to-aspnet-but-mvc-frameworks-like-ruby-on-rails-are-more-mature/</link>
		<comments>http://adam.kahtava.com/journal/2008/11/26/mvc-is-a-welcome-addition-to-aspnet-but-mvc-frameworks-like-ruby-on-rails-are-more-mature/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 03:01:29 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,3cc6f99a-4716-46bb-a9bf-f1bfc46274b0.aspx</guid>
		<description><![CDATA[The Model View Controller (MVC) pattern is a great addition to ASP.NET. The MVC pattern was first described in 1979 by the SmallTalk community - those crazy SmallTalk guys!
Today Wikipedia lists 80 different web frameworks that use MVC - with Java and PHP topping the list for the languages with the most MVC web frameworks. [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model View Controller (MVC)</a> pattern is a great addition to ASP.NET. The MVC pattern was first described in 1979 by the SmallTalk community - <em>those crazy SmallTalk guys!</em></p>
<p>Today <a href="http://en.wikipedia.org/wiki/Model-view-controller#Implementations_of_MVC_as_web-based_frameworks">Wikipedia lists 80 different web frameworks that use MVC</a> - with Java and PHP topping the list for the languages with the most MVC web frameworks. MVC enforces a separation of responsibilities: Markup / CSS / JavaScript, Domain Objects / Containers, and Actions / Controls are broken up into their respective directories. In addition MVC provides the ability to test most of your code and is more intuitive with how the web works (REST like, based on URIs, plays nicer with the browser, and not dependent on POST backs).</p>
<p><strong>Finding good resources specifically for ASP.NET MVC is impossible at this time, but <a href="http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Dstripbooks&amp;amp;field-keywords=rails&amp;amp;x=13&amp;amp;y=23">the books covering Ruby on Rails (RoR)</a> are invaluable.</strong> RoR has been around since 2005, it uses the same basic MVC approach, similar routing, similar control structure, has a mature community, a large collection of plug-ins, and well established tools (anyone claiming that ASP.NET MVC can't do what WebForms can, should look to Rails as an example). <em>Gasp! It's almost like ASP.NET MVC has copied Rails!! :)</em></p>
<p>Anyhow; the more I learn about Rails and Ruby, the more I realized that the communities like RoR (SmallTalk, and even some of the PHP world) are years ahead of my native .NET community. At this point I'm considering abandoning .NET in favour of Ruby / Rails / RSpec or at least Merb / Ruby / RSpec. In the future when ASP.NET MVC and IronRuby are more mature or when the corporate world starts using ASP.NET MVC (read <em>never ever!</em>) or when I'm approached to work on an ASP.NET MVC project I might move back into ASP.NET. <strong>In the mean time I'd like to contribute to IronRuby as I work towards jumping my current technology stack. </strong>I've armed myself with Textmate (the <a href="http://www.e-texteditor.com/">E Text Editor</a>) and a MacBook Pro is in my future. I'll get back to you on how this goes. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/11/26/mvc-is-a-welcome-addition-to-aspnet-but-mvc-frameworks-like-ruby-on-rails-are-more-mature/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Winforms / Webforms Can Make You Obsolete: Framework or Metaphor Lock-in is a Liability For Your Career</title>
		<link>http://adam.kahtava.com/journal/2008/10/13/winforms-webforms-can-make-you-obsolete-framework-or-metaphor-lock-in-is-a-liability-for-your-career/</link>
		<comments>http://adam.kahtava.com/journal/2008/10/13/winforms-webforms-can-make-you-obsolete-framework-or-metaphor-lock-in-is-a-liability-for-your-career/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 15:47:45 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[CSharp]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Musings]]></category>

		<category><![CDATA[Programming Languages]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,f1df3cbd-b0b0-4d78-95e2-1ff113acd6d7.aspx</guid>
		<description><![CDATA[I've always been uncomfortable with the ASP.NET Webform / Winform metaphor - I moved to ASP.NET from ASP 3.0 / PHP with no proper Windows development experience. The Webform / Winform metaphor was alien, but the code behind model and the ability to re-use controls drew me in, while the Webform metaphor became a tolerated [...]]]></description>
			<content:encoded><![CDATA[<p>I've always been uncomfortable with the ASP.NET Webform / Winform metaphor - I moved to ASP.NET from ASP 3.0 / PHP with no proper Windows development experience. The Webform / Winform metaphor was alien, but the code behind model and the ability to re-use controls drew me in, while the Webform metaphor became a tolerated evil. Today ASP.NET MVC and the announcement that Microsoft has embraced jQuery keeps me interested.</p>
<p>As developers, limiting ourselves to a single metaphor, framework, or programming language is a liability to our career. In order to remain employable and engaged with our work, we need to understand the higher level concepts surrounding our chosen development arena - if you're working in the webspace this means knowing CSS, JavaScript, HTML, and more than one server-side language. Then beyond technologies and languages we should be looking at transcending principals like design patterns, and good design practices.</p>
<blockquote><p>identifying with anything so strongly that it starts to give you emotional reaction is really bad. <strong>You never know when your language is going to be obsolete or ... your favorite framework is going to be replaced.</strong> ... I would love to see everybody learn a bunch of languages because it does make you a better programmer. ... Most people will never switch languages. - Steve Yegge, <a href="http://blog.stackoverflow.com/2008/10/podcast-25/">stackoverflow podcast #25</a>Â </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/10/13/winforms-webforms-can-make-you-obsolete-framework-or-metaphor-lock-in-is-a-liability-for-your-career/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How To Display Your Amazon Reviews and Wish List (on your site) Using Amazon&#8217;s Web Services</title>
		<link>http://adam.kahtava.com/journal/2008/10/06/how-to-display-your-amazon-reviews-and-wish-list-on-your-site-using-amazons-web-services/</link>
		<comments>http://adam.kahtava.com/journal/2008/10/06/how-to-display-your-amazon-reviews-and-wish-list-on-your-site-using-amazons-web-services/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 22:55:43 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[Amazon]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,e44d5916-5c12-4b66-a1a0-65bab52ed58c.aspx</guid>
		<description><![CDATA[
If you've ever landed on Amazon then you're probably familiar with their reviews and wish lists. Amazon provides access to these items (and many-many more) through their extensive web services - the Amazon web services can be complex and overwhelming when all you want is a review list and a single user specific wish list. [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 0px 0px 10px 5px; float: right;"><img src="http://awsmedia.s3.amazonaws.com/logo_aws.gif" alt="" /></div>
<p>If you've ever landed on Amazon then you're probably familiar with their <a href="http://www.amazon.com/gp/cdp/member-reviews/A2JM0EQJELFL69/ref=cm_pdp_rev_all?ie=UTF8&amp;sort_by=MostRecentReview">reviews</a> and <a href="http://www.amazon.com/gp/registry/registry.html/ref=cm_pdp_wish_all_itms?ie=UTF8&amp;type=wishlist&amp;id=3JU6ASKNUS7B8">wish lists</a>. Amazon provides access to these items (and many-many more) through their extensive web services - the Amazon web services can be complex and overwhelming when all you want is a review list and a single user specific wish list. For this site I wanted to pull in my reviews and wish list - displaying them alongside my blog. <em>It's fair to note, that user reviews are available via an <a href="http://www.amazon.com/rss/people/A2JM0EQJELFL69/reviews/ref=cm_pdp_rev_rss">RSS feed</a> (but this feed doesn't include all the details I wanted) and the wish list page still doesn't provide an RSS feed.</em> So a custom Amazon web service request was in order.</p>
<p><strong>Let me try to make this story short.</strong></p>
<p>If you want to request your reviews and your wish list you need the following:</p>
<ul>
<li> An Amazon Account: <a href="http://www.amazon.com/gp/css/homepage.html">http://www.amazon.com/gp/css/homepage.html</a> with at least a wish list or a review.</li>
<li> An Amazon Associates tag: <a href="https://affiliate-program.amazon.com/gp/associates/join/">https://affiliate-program.amazon.com/gp/associates/join/</a> (this will be your <strong>AssociatesTag</strong>).</li>
<li> An Amazon Web Service (AWS) access key: <a href="http://aws.amazon.com/">http://aws.amazon.com/</a> (this will be your <strong>AWSAccessKey</strong>).</li>
</ul>
<p>Once you have a wish list or review, you then need to:</p>
<ul>
<li> Get your <strong>CustomerId</strong> for the reviews. <em>I found my CustomerId by navigating to my reviews (<a href="http://www.amazon.com/gp/cdp/member-reviews/A2JM0EQJELFL69/">http://www.amazon.com/gp/cdp/member-reviews/A2JM0EQJELFL69/</a>) then pulling out 'A2JM0EQJELFL69' (the last element of the url).</em></li>
<li> Get your <strong>ListId</strong> for your wish list.Â  <em>I found my ListId by navigating to my wishlist (<a href="http://www.amazon.com/gp/registry/registry.html/?id=3JU6ASKNUS7B8">http://www.amazon.com/gp/registry/registry.html/?id=3JU6ASKNUS7B8</a>) then pulling out '3JU6ASKNUS7B8' (the identifier after id= from the url).</em></li>
</ul>
<p>Once you've collected all those bits, you need to:</p>
<ul>
<li> Checkout and download the <a href="http://code.google.com/p/adamdotcom-amazon/source/checkout">source code</a> for the project and build the assembly or download the <a href="http://adamdotcom-amazon.googlecode.com/files/AdamDotCom.Amazon.dll">pre-compiled assembly</a>.</li>
<li> Add the assembly reference to your project (remember, I'm assuming you're using .NET).</li>
<li> Make a call to the application which will generate XML files containing your respective reviews and wish list.</li>
</ul>
<p>Setting up the call would look something like this:</p>
<pre><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #2b91af;">IAmazonRequest</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"> amazonRequest = <span style="color: blue;">new</span> <span style="color: #2b91af;">AmazonRequest</span>()</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;">{</span>
<span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>AssociateTag = <span style="color: #a31515;">"adamkahtavaap-20"</span>,
</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>AWSAccessKeyId = </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span style="color: #a31515;">"1MRF________MR2"</span></span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;">,
</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>CustomerId = <span style="color: #a31515;">"A2JM0EQJELFL69"</span>,
</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>ListId = <span style="color: #a31515;">"3JU6ASKNUS7B8"</span></span>
<span style="font-size: 8pt; font-family: &quot;Courier New&quot;;">};</span>

<span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #2b91af;">IFileParameters</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"> fileParameters = <span style="color: blue;">new</span> <span style="color: #2b91af;">FileParameters</span>()</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;">{
</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>ProductFileNameAndPath = <span style="color: #a31515;">@"Products.xml"</span>,
</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>ReviewFileNameAndPath = <span style="color: #a31515;">@"Reviews.xml"</span>,
</span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"><span> </span>ErrorFileNameAndPath = <span style="color: #a31515;">@"Errors.xml"</span><span>
</span></span> <span style="font-size: 8pt; font-family: &quot;Courier New&quot;;">};</span>

<span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #2b91af;">IAmazonApplication</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"> amazonApplication = <span style="color: blue;">new</span> <span style="color: #2b91af;">AmazonApplication</span>(amazonRequest, fileParameters);</span>

<span style="font-size: 8pt; line-height: 115%; font-family: &quot;Courier New&quot;;">amazonApplication.Save();</span></pre>
<p>And Viola!</p>
<p>If you'd like to provide some design guidance, fix a bug, or request a feature, then visit (or join) <a href="http://code.google.com/p/adamdotcom-amazon/">the project</a> on Google Code. <em> </em></p>
<p><em> </em></p>
<p><em> Alternatively, you might also be interested in the <a href="http://linqinaction.net/files/folders/linqinaction/entry1952.aspx">LINQ To Amazon</a> source featured in the book <a href="http://www.amazon.com/LINQ-Action-Fabrice-Marguerie/dp/1933988169">LINQ in Action</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/10/06/how-to-display-your-amazon-reviews-and-wish-list-on-your-site-using-amazons-web-services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Microsoft and jQuery Finally: Thank-You!</title>
		<link>http://adam.kahtava.com/journal/2008/09/28/microsoft-and-jquery-finally-thank-you/</link>
		<comments>http://adam.kahtava.com/journal/2008/09/28/microsoft-and-jquery-finally-thank-you/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 19:29:57 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,30d337b1-12ca-40dd-9dc0-4e1bfacf2483.aspx</guid>
		<description><![CDATA[
Microsoft is looking to make jQuery part of their official development platform ... jQuery will be distributed with Visual Studio
- jQuery, Microsoft, and Nokia
Other links of interest:

Scott Hanselman: jQuery to ship with ASP.NET MVC and Visual Studio
Scott Guthrie: jQuery and Microsoft

I was completely blindsided by this decision.
]]></description>
			<content:encoded><![CDATA[<div style="float: right;"><img style="padding: 10px; background-color: black;" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" alt="" /></div>
<blockquote><p>Microsoft is looking to make jQuery part of their official development platform ... jQuery will be distributed with Visual Studio<br />
- <a href="http://jquery.com/blog/2008/09/28/jquery-microsoft-nokia/">jQuery, Microsoft, and Nokia</a></p></blockquote>
<p>Other links of interest:</p>
<ul>
<li>Scott Hanselman: <a href="http://www.hanselman.com/blog/jQueryToShipWithASPNETMVCAndVisualStudio.aspx">jQuery to ship with ASP.NET MVC and Visual Studio</a></li>
<li>Scott Guthrie: <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">jQuery and Microsoft</a></li>
</ul>
<p>I was completely blindsided by this decision.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/09/28/microsoft-and-jquery-finally-thank-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Writing a Control for the AJAX Control Toolkit: How ASP.NET AJAX Failed</title>
		<link>http://adam.kahtava.com/journal/2008/06/07/writing-a-control-for-the-ajax-control-toolkit-how-aspnet-ajax-failed/</link>
		<comments>http://adam.kahtava.com/journal/2008/06/07/writing-a-control-for-the-ajax-control-toolkit-how-aspnet-ajax-failed/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 19:19:42 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,323c98c8-c4dd-4dd7-8cc3-b65178f32db2.aspx</guid>
		<description><![CDATA[One of my resolutions this year was to contribute to the AJAX Control Toolkit for the ASP.NET AJAX Framework. I began my AJAX Control Toolkit development quest by digging into the online resources, reading ASP.NET AJAX in Action, and decomposing the AJAX Control Toolkit. I noted the huge learning curve required to developing a control, [...]]]></description>
			<content:encoded><![CDATA[<p>One of my resolutions this year was to contribute to the <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/">AJAX Control Toolkit</a> for the <a href="http://asp.net/ajax/">ASP.NET AJAX Framework</a>. I began my AJAX Control Toolkit development quest by digging into the online resources, reading <a href="http://adam.kahtava.com/journal/2008/04/20/book-reviewed-aspnet-ajax-in-action-by-alessandro-gallo-david-barkol-rama-vavilala/">ASP.NET AJAX in Action</a>, and decomposing the AJAX Control Toolkit. I noted the huge <a href="http://adam.kahtava.com/journal/2008/04/09/the-aspnet-ajax-learning-curve/">learning curve</a> required to developing a control, and continued to dig deeper. Once mired in ASP.NET AJAX a bad smell kept wafting by. Since then I've been <a href="http://adam.kahtava.com/journal/2008/06/03/more-on-the-perils-of-the-aspnet-ajax-framework/">trying</a> to distinguish this smell.</p>
<p><strong>What's really wrong with ASP.NET AJAX?</strong></p>
<ul>
<li> It doesn't plan for performance from day one</li>
<li> It treats AJAX as a classic computer science problem</li>
<li> It tries to turn JavaScript into a classical language which works against JavaScript's dynamic, prototypical nature</li>
<li> It feels like a framework that was written for dummies (<a href="http://adam.kahtava.com/journal/2009/02/05/dont-write-frameworks-for-dummies/">Don't Write Frameworks For Dummies</a>)</li>
</ul>
<p><strong>A Case Study: Why Plaxo.com Almost Failed</strong></p>
<p>In the video: <a href="http://video.yahoo.com/watch/1041101">High-performance JavaScript: Why Everything You've Been Taught is Wrong</a> (<a href="http://developer.yahoo.com/yui/theater/">YUI Theater</a>) <a href="http://josephsmarr.com/">Joseph Smarr</a> discusses the challenges and lessons learned while developing <a href="http://www.plaxo.com/">Plaxo.com</a>. While developing this AJAX centric application, the Plaxo team decided to include everything they could think of into their application. <strong>They created a framework to treat JavaScript as a classical language, they gave priority to features over performance, and... the project ALMOST FAILED.</strong> They were able to salvage their application by diverting their development efforts, making performance one of their top priorities, by unlearning everything they'd been taught about classical applications (instead embracing JavaScript), jettisoning unneeded framework bloat, and more.</p>
<p>Some of the points made in this video were:</p>
<ul>
<li> Plan for performance from day one</li>
<li> AJAX is not a classic problem</li>
<li> JavaScript is not a classical programming language</li>
<li> User experience and a responsive application can make or break an application</li>
<li> Unneeded bloat in a framework, and an obtuse approach to using AJAX (treating AJAX and JavaScript as a classical language or classic computer science problem) has the potential to cripple your application</li>
</ul>
<p>This Channel 9 video also mirrors these sentiments: <a href="http://channel9.msdn.com/posts/Charles/Douglas-Crockford-Alex-Russell-and-Joseph-Smarr-On-the-Past-Present-and-Future-of-JavaScript/">Douglas Crockford, Alex Russell and Joseph Smarr: On the Past, Present and Future of JavaScript</a></p>
<p><strong>How ASP.NET AJAX Failed: What can we learn from Plaxo?</strong></p>
<p>The way the Plaxo team approached their application development is similar to how the ASP.NET AJAX Framework has been designed. Like Plaxo's initial attempt ASP.NET AJAX attempts to mold JavaScript into a classical language, and attempts to treat JavaScript and AJAX as a classic computer science problem by heaping on more abstractions. Like Plaxo's initial attempt ASP.NET AJAX also gives a low priority to performance. Plaxo was able to change their direction and salvaged their application, but the ASP.NET AJAX Framework is not in a position to make any sweeping changes - ASP.NET AJAX is going down the wrong path and it's too late.</p>
<p>The ASP.NET AJAX Framework is probably another exercise in Framework Architecture (<a href="http://en.wikipedia.org/wiki/Demoware">demoware</a>) and a failure in practice. Its lack of use in the wild attests to these shortcomings - contrast the <a href="http://www.asp.net/ajax/showcase/">sites using ASP.NET AJAX</a> with the <a href="http://docs.jquery.com/Sites_Using_jQuery">sites using jQuery</a> (<a href="http://adam.kahtava.com/journal/2008/05/15/actions-speak-louder-than-words-goodbye-aspnet-ajax/">Actions Speak Louder Than Words</a>). Furthermore the places that ASP.NET AJAX does thrive (the small internal ASP.NET business apps that need some bling-bling) will also be the areas that <a href="http://en.wikipedia.org/wiki/Silverlight">Silverlight</a> shines - Silverlight offers a better Microsoft centric programming model (less leaky Win Form / Web Form abstractions) that most Microsoft developers will embrace. Silverlight will probably divert the developers that currently embrace ASP.NET AJAX.</p>
<p>I don't recommend the ASP.NET AJAX Framework and won't be contributing to the AJAX Control Toolkit. My time is better spent elsewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/06/07/writing-a-control-for-the-ajax-control-toolkit-how-aspnet-ajax-failed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More on the perils of The ASP.NET AJAX Framework</title>
		<link>http://adam.kahtava.com/journal/2008/06/03/more-on-the-perils-of-the-aspnet-ajax-framework/</link>
		<comments>http://adam.kahtava.com/journal/2008/06/03/more-on-the-perils-of-the-aspnet-ajax-framework/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 15:06:27 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DOM]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,128d00d5-c819-417b-996f-268676243143.aspx</guid>
		<description><![CDATA[There's no need to whip a dead horse (I've probably been griping about the ASP.NET AJAX Framework for too long), but... Jon Galloway and a group of other notable gurus (K. Scott Allen, Scott Koon, and Kevin Dente) have started a podcast, their latest segment sparked my interest since it covered ASP.NET AJAX and AJAX [...]]]></description>
			<content:encoded><![CDATA[<p>There's no need to whip a dead horse (I've probably been griping about the ASP.NET AJAX Framework for too long), but... <a href="http://weblogs.asp.net/jgalloway/default.aspx">Jon Galloway</a> and a group of other notable gurus (<a href="http://www.odetocode.com/">K. Scott Allen</a>, <a href="http://www.lazycoder.com/">Scott Koon</a>, and <a href="http://weblogs.asp.net/kdente/">Kevin Dente</a>) have started a podcast, their latest segment sparked my interest since it covered ASP.NET AJAX and AJAX Libraries / Frameworks in general.</p>
<p>I share their sentiments so I thought I'd post a brief but choppy transcript:</p>
<blockquote><p>[ASP.NET AJAX] ... does offer some some nice features, they did try to take some of the common pieces of the CLR that [.NET Developers are] used to working with and move that down into a JavaScript library. So you get classes like a <a href="http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys.Net/WebRequestClass/default.aspx">WebRequest</a> class that wraps the <a href="http://en.wikipedia.org/wiki/XMLHttpRequest">XMLHttpRequest</a> ... and they have a <a href="http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys/StringBuilderClass/default.aspx">StringBuilder</a>, and they added methods that we're more accustom with ...</p>
<p>that's wonderful, but I don't find myself needing those extensions all that often.<strong> If you want to do strictly client-side programming then something like jQuery offers you a lot more capabilities to do things that you really want to do client-side like sorting and CSS selectors.</strong> ... That stuff is easy to do with an Update Panel and ASP.NET, but Update Panels aren't always the best solution to use. ...</p>
<p>the goals with ASP.NET AJAX was to integrate into the ASP.NET server-side model ... that's great for ASP.NET, but it needs more client-side features. ... It works if your thinking from the ASP.NET control perspective, but <strong>if you look at it outside the ASP.NET model there are a lot easier ways to do it. </strong>...</p>
<p>ASP.NET AJAX [development] seems to have come to a standstill I'm not seeing a lot of development in that area and the rest of these [AJAX] Frameworks are doing monthly releases. <strong>Every month that goes by [the ASP.NET AJAX Framework] falls further and further behind ... it needs to evolve.</strong></p></blockquote>
<p>Listen to this podcast here: <a href="http://weblogs.asp.net/jgalloway/archive/2008/05/29/technology-round-table-podcast-2-ajax-frameworks.aspx">Technology Round Table Podcast #2 - AJAX Frameworks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/06/03/more-on-the-perils-of-the-aspnet-ajax-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting a Job at Google: A Web Developer Fizzbuzz</title>
		<link>http://adam.kahtava.com/journal/2008/05/24/getting-a-job-at-google-a-web-developer-fizzbuzz/</link>
		<comments>http://adam.kahtava.com/journal/2008/05/24/getting-a-job-at-google-a-web-developer-fizzbuzz/#comments</comments>
		<pubDate>Sat, 24 May 2008 21:03:23 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[Google Exercise]]></category>

		<category><![CDATA[IE]]></category>

		<category><![CDATA[Interview]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Programming Languages]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,8cfd415e-f895-4115-8713-5a879e1abb15.aspx</guid>
		<description><![CDATA[Back when the web turned 2.0, AJAX was all the rage, and gas was cheap, a Google recruiter contacted me. We worked through a couple screening interviews - I explained how I was a .NET / ASP.NET / C# developer with some experience with Java and PHP, I described how C# was somewhat similar to [...]]]></description>
			<content:encoded><![CDATA[<p>Back when the web turned 2.0, AJAX was all the rage, and gas was cheap, a Google recruiter contacted me. We worked through a couple screening interviews - I explained how I was a .NET / ASP.NET / C# developer with some experience with Java and PHP, I described how C# was somewhat similar to Java. Things went great, I moved on to the next step of the process - writing code (a JavaScript widget for Gmail) with a 2 day (weekend) hard deadline. At the time I was wearing JavaScript diapers, but tried the exercise anyways - I&#39;m still convinced the recruiter confused my Java / C# experience with JavaScript. Anyhow... </p>
<p> <b>The Google Web Developer Exercise:<br /> </b><br />
<blockquote style="border: 1px solid rgb(207, 207, 207); padding-left: 7px;">
<h3>Web Developer Exercise </h3>
<p> Attached are three states of a new contacts widget. This widget will be used across Google and may be anywhere on the page. Designers will also use this in mocks for usability tests. Create the HTML, CSS, and JavaScript for the widget as described in the image. Your solution must work in Firefox v1.5+ and IE v6+. Bonus points for a solution that degrades nicely on older browsers.</p>
<p> <img src="http://adam.kahtava.com/journal/images/blog/GoogleExercise02.png"> <br /> <img src="http://adam.kahtava.com/journal/images/blog/GoogleExercise03.png"> <br /> <img src="http://adam.kahtava.com/journal/images/blog/GoogleExercise01.png">  </p></blockquote>
<p><b>After my first attempt, I concluded that: </b> <br /> 
<ol>
<li> My JavaScript knowledge was embarrassing  </li>
<li> <a href="http://en.wikipedia.org/wiki/Dynamic_language">Dynamic programming languages</a> like JavaScript using <a href="http://en.wikipedia.org/wiki/Prototype-based_programming">prototypical inheritance</a> were awesome - as a monocultured .NET developer I had sorely been missing out</li>
<li> Framework Web Developers (ASP.NET, Ruby on Rails, and so on) aren&#39;t really Web Developers - we depend on a framework (an API) as a crutch, where the law of <a href="http://en.wikipedia.org/wiki/Leaky_abstraction">Leaky Abstractions</a> is very real, and often when it rears it&#39;s head we use our <a href="http://en.wikipedia.org/wiki/Golden_hammer">golden hammer</a> (our multipurpose language of choice), but there are better tools at hand </li>
<li> Web Developers claiming <i>n</i> years of experience need to at least know JavaScript, CSS, HTML / XHTML, a server-side language, and some XML / XSL - NOT just a single multipurpose language or framework </li>
<li> Innovation can only happen when you become <i>one</i> with the technologies surrounding your realm - for example: <a href="http://adaptivepath.com/ideas/essays/archives/000385.php">Jesse James Garrett</a> probably would not have publicized AJAX had he been an exclusive ASP.NET developer. Diversity is essential for innovation </li>
</ol>
<p> In retrospect this exercise is brilliant, it&#39;s a more complex derivation of a <a href="http://www.codinghorror.com/blog/archives/000781.html">Fizzbuzz exercise</a>, which effectively weeds out the knowledgeable candidates from the n00bs. JavaScript is notorious for being one of <a href="http://www.crockford.com/javascript/javascript.html">the world&#39;s most misunderstood language</a>, many developer (and the ASP.NET Framework) still use JavaScript techniques from the old days of Netscape. For example: <i>&lt;a onclick="return false;" ...</i>, or &lt;a <i>href="Javascript: do something;" ...</i> are common <a href="http://en.wikipedia.org/wiki/DOM_Events#DOM_Level_0">DOM Level 0</a> inline techniques that should be avoided. These techniques have been replaced, but finding developer that use these JavaScript techniques can be hard.</p>
<p> <b>By having a developer complete this exercise you effectively determine that the they understands these concepts:</b> <br /> 
<ul>
<li> Cross browser compatibilities and work arounds for both JavaScript and CSS - with a preference given to <a href="http://www.quirksmode.org/js/support.html">feature detection (object detection)</a> vs browser detection, an understanding of the different event handling models between browsers </li>
<li> An understanding of the separation of concerns - JavaScript, markup, and CSS should be separate files, or at least separated within the document </li>
<li> Event registration and listening - <a href="http://en.wikipedia.org/wiki/DOM_Events">DOM events</a>, the different browser event models, no inline level 0 event declarations, no pseudo JavaScript protocol inline declarations within markup </li>
<li> An understanding of <a href="http://en.wikipedia.org/wiki/Functional_languages">functional languages</a> - <a href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29">closures</a>, <a href="http://adam.kahtava.com/journal/2008/03/17/NamespacingYourJavaScript.aspx">namespaces</a>, <a href="http://en.wikipedia.org/wiki/Lambda_calculus">lambdas</a>, recursion where necessary </li>
<li> Node manipulation - creating, swapping, removing elements</li>
<li> Knowledge of <a href="http://icant.co.uk/articles/seven-rules-of-unobtrusive-javascript/">non-obtrusive JavaScript techniques</a> </li>
<li> Importance of modular / compartmentalization of CSS and JavaScript - defensive programming techniques that minimize the risk of interfering with other scripts and elements within the page, part of the non-obtrusive techniques, how to avoid global variables</li>
<li> An understanding on how to debug JavaScript from both IE (<a href="http://www.jonathanboutelle.com/mt/archives/2006/01/howto_debug_jav.html">link</a>) and Firefox (<a href="http://www.getfirebug.com/js.html">link</a>)</li>
<li> <a href="http://javascript.crockford.com/code.html">JavaScript code conventions</a> - naming conventions, statement conventions</li>
<li> CSS naming conventions</li>
<li> General DHTML / AJAX techniques - showing and hiding elements </li>
<li> A gauge on their attention to details and UI design intuition - what their gut tells them to do when things aren&#39;t spelled out</li>
</ul>
<p> <b>My latest crack at the Google Web Developer Exercise:</b>  <br /> <iframe src="http://adam.kahtava.com/etcetera/google-web-developer-exercises/non-semantic-pure-javascript/" style="border-width: 0px; width: 320px; height: 300px; margin-left: 15px; float: left;"> </iframe> <br /> <i>You&#39;ll have to visit my site (view this blog post outside a RSS reader) to view the code in action.</p>
<p> </i>The code: <a href="http://adam.kahtava.com/etcetera/google-web-developer-exercises/non-semantic-pure-javascript/GoogleExercise.js">GoogleExercise.js</a>, <a href="http://adam.kahtava.com/etcetera/google-web-developer-exercises/non-semantic-pure-javascript/index.html">index.html</a>, <a href="http://adam.kahtava.com/etcetera/google-web-developer-exercises/non-semantic-pure-javascript/GoogleExercise.css">GoogleExercise.css</a> </p>
<p> <i>Today I&#39;m wearing JavaScript training wheels - </i><i>feel free to comment on the code, I&#39;m always looking for improvements and suggestions. I did take a couple shortcuts on the CSS / UI side of things as I was focusing more on the functionality.</i>  </p>
<p> <i>Using one of the <a href="http://en.wikipedia.org/wiki/Ajax_Libraries">AJAX Libraries</a> (like <a href="http://jquery.com/">jQuery</a>) we could certainly do this exercise in significantly fewer lines of code.</p>
<p> </i>
<div style="clear: both;">Today I still think about <a href="http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html">Getting that job at Google</a>, Yahoo!, Amazon, or Microsoft. <a href="http://adam.kahtava.com/journal/2008/01/13/HowWellDoYouKnowJavaScript.aspx">How well do you know JavaScript?</a> </p></div>
<div style="border: 1px solid #ccccee; padding: 5px; background-color: #ffffdd;"><strong>Update:</strong> I redid the Google Exercise using jQuery and more semantics, you can find my latest version here: <a href="http://adam.kahtava.com/journal/2009/07/09/the-google-exercise-revisited-semantic-markup-with-jquery/">The Google Exercise Revisited: Semantic Markup with jQuery</a>.</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/05/24/getting-a-job-at-google-a-web-developer-fizzbuzz/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Actions Speak Louder Than Words: Goodbye ASP.NET AJAX</title>
		<link>http://adam.kahtava.com/journal/2008/05/15/actions-speak-louder-than-words-goodbye-aspnet-ajax/</link>
		<comments>http://adam.kahtava.com/journal/2008/05/15/actions-speak-louder-than-words-goodbye-aspnet-ajax/#comments</comments>
		<pubDate>Thu, 15 May 2008 22:35:19 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,200ba4e0-3818-4709-9277-91f85a3ee625.aspx</guid>
		<description><![CDATA[An anticlimactic conclusion about the ASP.NET AJAX Framework - this framework's niche seems to be the internal (intranet) business application realm that depend on ASP.NET Web-Forms. These applications have a handful of users, a couple developers, no performance or bandwidth requirements, little ambition for future growth, and the developers typically embrace dragging &#38; dropping controls [...]]]></description>
			<content:encoded><![CDATA[<p>An anticlimactic conclusion about the ASP.NET AJAX Framework - this framework's niche seems to be the internal (intranet) business application realm that depend on ASP.NET Web-Forms. These applications have a handful of users, a couple developers, no performance or bandwidth requirements, little ambition for future growth, and the developers typically embrace dragging &amp; dropping controls in Visual Studio. In this case the ASP.NET AJAX Framework provides some eye candy, and patches the broken Web-Form metaphor by cramming AJAX into the ASP.NET model, but then comes along the ASP.NET MVC Framework, Silverlight, WPF and ... ??? Goodbye ASP.NET AJAX!</p>
<p><strong>Interesting observations:</strong></p>
<p>How many applications explicitly state that they use the <strong>ASP.NET AJAX</strong> Framework?</p>
<ul>
<li> <strong>25</strong>, this includes sites like <a href="http://www.dotnetnuke.com/">DotNetNuke</a> (with a reputation of being slow), view the list <a href="http://www.asp.net/ajax/showcase/">here</a>.</li>
</ul>
<p>How many of these applications are relatively high-traffic?</p>
<ul>
<li> <strong>None. ZERO!</strong></li>
</ul>
<p>How many applications explicitly state that they use the <strong>YUI</strong> library?</p>
<ul>
<li> <strong>89,</strong> view the list <a href="http://209.73.186.27/yui/poweredby/">here</a> and <a href="http://tech.groups.yahoo.com/group/ydn-javascript/links/YUI_Implementations_001149002597/">here</a>.<strong><br />
</strong></li>
</ul>
<p>How many of these applications are relatively high-traffic?</p>
<ul>
<li> <strong>Quite a few. </strong>A couple notable sites: Flickr, Slashdot, Linkedin, Paypal, O'Reilly, My Opera.</li>
</ul>
<p>How many applications explicitly state that they use the <strong>jQuery</strong> AJAX Library?</p>
<ul>
<li> <strong>516</strong> and growing, view the list <a href="http://docs.jquery.com/Sites_Using_jQuery">here</a>.<strong><br />
</strong></li>
</ul>
<p>How many of these applications are relatively high-traffic?</p>
<ul>
<li> <strong>Many.</strong> A couple notable sites: Twitter, Digg, Dell, Slashdot, BBC, Netflix, Technorati, New York Post.</li>
</ul>
<p>If no high-traffic application uses the ASP.NET AJAX Framework then why would you? Actions (or lack of action) often speak louder than words, and it appears that the ASP.NET AJAX Framework is not suitable for the real world.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/05/15/actions-speak-louder-than-words-goodbye-aspnet-ajax/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The ASP.NET AJAX Framework is for Dummies</title>
		<link>http://adam.kahtava.com/journal/2008/04/21/the-aspnet-ajax-framework-is-for-dummies/</link>
		<comments>http://adam.kahtava.com/journal/2008/04/21/the-aspnet-ajax-framework-is-for-dummies/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:09:35 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Programming Languages]]></category>

		<category><![CDATA[Review]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,f3b618d7-4a7d-4892-88d4-3b85bcb01555.aspx</guid>
		<description><![CDATA[
The ASP.NET AJAX Framework is an embarrassing server-side centric approach to DHTML / AJAX web development. While most programming languages and frameworks come with both good and bad parts, the ASP.NET AJAX FrameworkÂ is anÂ example of a bad part - on the contrast the ASP.NET MVC Framework looks to be a good part.
What's wrong with the [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 0px 0px 5px 5px; float: right;"><a href="http://www.flickr.com/photos/chuckbiscuito/161971512/"><img style="border: 0px none ;" src="http://farm1.static.flickr.com/78/161971512_bc7776cc98_m.jpg" alt="" /></a></div>
<p>The <a href="http://www.asp.net/ajax/">ASP.NET AJAX Framework</a> is an embarrassing server-side centric approach to DHTML / AJAX web development. While most programming languages and frameworks come with both <em>good</em> and <em>bad</em> parts, the ASP.NET AJAX FrameworkÂ is anÂ example of a <em>bad part</em> - on the contrast the <a href="http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework">ASP.NET MVC Framework</a> looks to be a <em>good part</em>.</p>
<p><strong>What's wrong with the ASP.NET AJAX Framework?</strong></p>
<p><strong>1 .NET Developers are DUMMIES!<br />
</strong>The ASP.NET AJAX Framework appears to have been designed under the assumption that <strong>.NET developers are dummies and can't learn or don't want to learn JavaScript</strong>. That .NET Developers would rather hobble along with their familiar languages, then to learn something new. I understand that <a href="http://weblogs.asp.net/jeff/archive/2008/03/26/the-asp-net-community-s-only-real-problem-is-education.aspx">the ASP.NET community's only real problem is education</a>, so let's ask: <a href="http://danhounshell.com/blogs/dan/archive/2008/03/24/what-is-wrong-with-the-asp-net-community.aspx">What is wrong with the ASP.NET Community?</a> Then educate ourselves rather than becoming the .NET Developer statuesque. It's patronizing to use a framework that assumes learning a new language is beyond our capabilities. Many of these other programming languages are more expressive than statically typed languages like most of the .NET languages.Â </p>
<p><strong>2. The <em>"don't write a line of JavaScript"</em> abstraction leaks like a sieve</strong><br />
The Framework is intended to shelter .NET Developers from the JavaScript language. Which, like driving a car across North America without knowing how to pump gas, stops you dead. Either you depend on someone to pump your gas - depend on a 3rd party (vendors or the ASP.NET AJAX Control Toolkit) and their many authors to write your JavaScript - or you stop moving. As Web Developers, sooner or later learning how to pump your own JavaScript becomes a mandatory skill.</p>
<p><strong>3. Client-side programming from the Server-side is a absurd</strong><br />
The AJAX Framework does back flips to translate server-side code into JavaScript, and then requires that you write JavaScript anyway. Save yourself the pain, learn JavaScript. One day <a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html">The Law of Leaky Abstractions</a> comes into play, the gas station attendant fills your gas tank with diesel - the AJAX Control Toolkit blows requires debugging and you have to learn JavaScript anyways.</p>
<p><strong>4. Bloated, poor performance, bad user and developer experience</strong><br />
The AJAX Framework extends many of the native JavaScript objects as it attempts to turn JavaScript into a <a href="http://en.wikipedia.org/wiki/Static_type#Static_typing">staticly typed</a> programming language, and tries to hook into the ASP.NET life cycle, but all these features are unneeded as they are <span style="text-decoration: underline;">ALL</span> already achievable through the native JavaScript language - <em>if it walks like a duck and quacks like a duck, then... err... could someone remind me why we need typed languages in a web browser?</em> Anyhow; all these object extensions, enhancements, and upgrades, contribute to more scripts that need to be downloaded and increases the number of scripts running in your browser. Then there's partial-page rendering and Update Panels which do full page post backs under the guise of AJAX. BAD! Client-side scripting is supposed to enhance the user experience not make it worse. Other AJAX Frameworks are built with performance as their number one goal, but in the ASP.NET AJAX Framework adding more widgets to JavaScript seemed to be the first priority, and performance an after thought.</p>
<p><strong>5. Working against the grain is a waste of time</strong><br />
The AJAX Framework works against the grain, it would be nice if it embraced the JavaScript language. Very few of the concepts and metaphors used in the ASP.NET AJAX Framework transcendÂ AJAX techniques or frameworksÂ - your time is probably better spent learning how JavaScript works or how the other <a href="http://en.wikipedia.org/wiki/Ajax_framework">AJAX frameworks</a> work.</p>
<p><strong>6. Disconnected from the ASP.NET MVC Framework</strong><br />
The ASP.NET MVC Framework throws the ASP.NET life cycle away leaving more dead weight ASP.NET AJAX Framework script and rendering many of the AJAX Framework techniques moot.</p>
<p><strong>7. The </strong><strong>ASP.NET AJAX Framework</strong><strong> almost over looks the 'J' in AJAX - 'J' stands for JavaScript (that's <span style="text-decoration: underline;">GOOD</span></strong>)<br />
JavaScript is the glue of the web, even the ASP.NET Framework depends heavily on JavaScript, it is not something to shy away from.</p>
<p><strong>8. Aside from local intranet sites, no one really uses the ASP.NET AJAX Framework.</strong><br />
The AJAX Framework isn't widely used. The ASP.NET AJAX site showcases <a href="http://www.asp.net/ajax/showcase/">25 sites</a> using ASP.NET AJAX. None of these applications appear to be high-traffic or moderately high-traffic applications. On the other hand, the YUI site showcases <a href="http://209.73.186.27/yui/poweredby/">89 sites</a>, out of these sites, 6 sites (flickr, Slashdot, Linkedin, Paypal, O'Reilly, My Opera) could be considered high-traffic. Other AJAX libraries like jQuery, and Dojo compare similarly. Your time might be better spent learning one of the other <a href="http://en.wikipedia.org/wiki/Ajax_framework">AJAX frameworks</a>.</p>
<p>If we (as .NET Developers) are going to claim we know AJAX, then let's focus on the core of AJAX (JavaScript) and stop obscuring it in poor frameworks. Frankly the ASP.NET AJAX Framework is embarrassing, <strong>the web development communityÂ is laughing at the ASP.NET AJAX Framework and the Developers touting it.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/04/21/the-aspnet-ajax-framework-is-for-dummies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Book Reviewed: ASP.NET AJAX in Action by Alessandro Gallo, David Barkol, Rama Vavilala</title>
		<link>http://adam.kahtava.com/journal/2008/04/20/book-reviewed-aspnet-ajax-in-action-by-alessandro-gallo-david-barkol-rama-vavilala/</link>
		<comments>http://adam.kahtava.com/journal/2008/04/20/book-reviewed-aspnet-ajax-in-action-by-alessandro-gallo-david-barkol-rama-vavilala/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 22:44:34 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<category><![CDATA[Book]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,49f1ae76-9a81-4559-9c19-768f088f304d.aspx</guid>
		<description><![CDATA[The authors of ASP.NET AJAX in Action did an OK (Average) job at presenting the ASP.NET AJAX Framework. However; this book lacked objectivity and suffered from hype. The authors didn&#39;t seem to have proficient experience with the JavaScript language, or enough experience with other AJAX Frameworks / Libraries, or sufficient experience using the ASP.NET AJAX [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/1933988142?ie=UTF8&amp;tag=adamkahtavaap-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1933988142"><img src="http://ecx.images-amazon.com/images/I/51V41qLtOWL._SL500_BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_.jpg" style="border: 0px none ; float: right;"></a>The authors of <a href="http://www.amazon.com/gp/product/1933988142?ie=UTF8&amp;tag=adamkahtavaap-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1933988142">ASP.NET AJAX in Action</a> did an <i>OK</i> (Average) job at presenting the ASP.NET AJAX Framework. However; this book lacked objectivity and suffered from hype. The authors didn&#39;t seem to have proficient experience with the JavaScript language, or enough experience with <u>other</u> AJAX Frameworks / Libraries, or sufficient experience using the ASP.NET AJAX Framework in real world projects. This book sadly felt like most technical books - average.</p>
<p> Comments like <i>"we recommend that..."</i>, <i>"because it makes no sense..."</i>, <i>"you must rely on a special method..."</i>, <i>"you must understand X,Y,Z to run complex client-side code without writing a single line of JavaScript"</i> were discouraging. Many of the <i>"whys"</i> were left answered and the technical inner workings of the framework often trivialized. Don&#39;t get me wrong, writing a book is incredibly time consuming, but if you&#39;re an author, presenter or the like, and you don&#39;t fully understand something then admit it. Do some research, provide some links, or move on. Consistently making comments like these bring the integrity of the whole text into question.</p>
<p> The ASP.NET AJAX Framework itself is technically flawed, bloated, and almost entirely impractical. I was disappointed with the server-centric approach that both the book and ASP.NET AJAX Framework takes. I was disappointed that the book continually pushed JavaScript under the carpet as magic and <b>at the end of the book I was pleased to see the promise of making <i>"the JavaScript code disappear"</i> </b><b>never </b><b>was&nbsp; fulfilled. </b>JavaScript is the very most important part of AJAX, without the <i>&#39;J&#39;</i> in AJAX, we&#39;re left with nothing - just <i>&#39;Asynchronous&#39;</i>, <i>&#39;And&#39;</i>, heaps of more ugly <i>&#39;XML&#39;</i>.</p>
<p> When reading this book, take the contents and the ASP.NET AJAX Framework with a grain of salt, if you&#39;re really serious about learning AJAX then read <a href="http://www.amazon.com/gp/product/0596101996?ie=UTF8&amp;tag=adamkahtavaap-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596101996">JavaScript: The Definitive Guide by David Flanagan</a>.  </p>
<p> <i>I typically only contribute positive reviews, but I don&#39;t agree with the majority of reviews found on Amazon and hope this review provides some objectivity. I commend the authors on their hard work, I&#39;m probably being too harsh with this review - I know it&#39;s tough to write a book, and imagine they made many sacrifices as they worked towards tight deadlines.</i> </p>
<p> View my review on <a href="http://www.amazon.com/gp/cdp/member-reviews/A2JM0EQJELFL69/ref=cm_pdp_reviews_see_all?ie=UTF8&amp;sort_by=MostRecentReview">Amazon</a>.<br /> </p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/04/20/book-reviewed-aspnet-ajax-in-action-by-alessandro-gallo-david-barkol-rama-vavilala/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Reflection on Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 (A Final Conclusion)</title>
		<link>http://adam.kahtava.com/journal/2008/04/07/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-a-final-conclusion/</link>
		<comments>http://adam.kahtava.com/journal/2008/04/07/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-a-final-conclusion/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 23:19:54 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,42f9acf9-af59-44fd-aef5-8d3ab773d5ba.aspx</guid>
		<description><![CDATA[A couple years ago I was thrown into a web application that made heavy use of ASP.NET Themes and Skins. Prior to this I depended exclusively on Cascading Style Sheet (CSS) for my web development / web design needs. A first glance at ASP.NET Themes and Skins looked promising, but a number of flaws surfaced [...]]]></description>
			<content:encoded><![CDATA[<p>A couple years ago I was thrown into a web application that made heavy use of ASP.NET Themes and Skins. Prior to this I depended exclusively on Cascading Style Sheet (CSS) for my web development / web design needs. A first glance at ASP.NET Themes and Skins looked promising, but a number of flaws surfaced - see the links and issues listed at the end of this post.</p>
<p>In addition to these issues, here are a couple other considerations when thinking about ASP.NET Themes:</p>
<ul>
<li> Themes do not adequately separate the levels of concerns within your application. When using Themes all design related files are baked into the application. From a maintainability standpoint, this doesn't bode well in large web applications. Hosting design related files on a single server or an external <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network">Content Delivery Network (CDN)</a> is an effective way for managing site wide UI updates and increasing a sites performance, ASP.NET Themes works against this technique.</li>
<li> Themes add unneeded complexity by obscuring the real technologies at work (CSS). Everything that ASP.NET Themes offer can be better achieved outside of the ASP.NET Theme Framework. Technologies like Cascading Style Sheets (CSS),Â  alternate Style Sheets, and JavaScript can achieve more than Themes can provide.</li>
<li> Themes are a server-side mechanism. Themes become a nuisance in client-side dependent, heavily dynamic, Web 2.0, DHTML, AJAX type web applications.</li>
<li> Themes discourage developers from learning more about web design and the technologies surrounding it. Themes offer a seemingly simple API, which shelters developers from the complexities of CSS and JavaScript, but sooner or later <a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html">The Law of Leaky Abstractions</a> comes into play and knowing the fundamentals of these technologies is a necessity.</li>
<li> Professional web designers don't use ASP.NET Themes, CSS is the language of web designers.</li>
</ul>
<p>Default Skins on the other hand can be useful for defining consistent CSS hooks into common ASP.NET controls. It's unfortunate that we can't use Skins without Themes.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Where it all Falls Apart</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder (Work Around #1)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s) (Work Around #2)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/">Defining the Load Order (Cascades) for CSS (Work Around #3)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style with Themes (Work Around #4)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/">Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/04/07/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-a-final-conclusion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Free: Win a Copy of Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages</title>
		<link>http://adam.kahtava.com/journal/2008/02/25/free-win-a-copy-of-professional-aspnet-20-design-css-themes-and-master-pages/</link>
		<comments>http://adam.kahtava.com/journal/2008/02/25/free-win-a-copy-of-professional-aspnet-20-design-css-themes-and-master-pages/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 14:40:51 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[Book]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Contest]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,8350b735-2367-413e-87cd-3ce717592130.aspx</guid>
		<description><![CDATA[Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages by Jacob Sanford is a great book for ASP.NET developers looking to expand their knowledge on the ASP.NET 2.0 Web Design front.  
 I&#39;ve read this book, re-read it, edited it, and would like to give it away - I was the Technical Editor. The [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/0470124482?ie=UTF8&amp;tag=adamkahtavaap-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0470124482"><img src="http://ecx.images-amazon.com/images/I/41Rc63UdxTL._AA240_SH20_.jpg" style="border: 0px none ; float: right;"></a><a href="http://www.amazon.com/gp/product/0470124482?ie=UTF8&amp;tag=adamkahtavaap-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0470124482">Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages</a> by Jacob Sanford is a great book for ASP.NET developers looking to expand their knowledge on the ASP.NET 2.0 Web Design front.  </p>
<p> I&#39;ve read this book, re-read it, edited it, and would like to give it away - I was the Technical Editor. The books is like new and (did I mention) it&#39;s free!
<p class="MsoNormal"> <b>Contest Rules:</b>  </p>
<ul>
<li> <font size="4">Updated! Just Leave a comment with a valid email address!</font> </li>
</ul>
<ul>
<li> <strike>Post a 500 x 200 pixel image of something you&#39;re working on in the comments of this post - this image could be code, web design, or anything work related.</strike> </li>
<li> <strike>Include an optional description of your work</strike> </li>
<li> The winner will be chosen <strike>April 1st</strike> May 1st, they&#39;ll be drawn at random, and will be notified through email.</li>
<li> I pay for shipping.</li>
</ul>
<p> <i>* I&#39;ve included a sample entry in the comments. If you&#39;re looking for a great free photo editing application then try <a href="http://www.getpaint.net/">Paint.net</a>. If you&#39;re looking to host your image you might want to consider <a href="http://www.flickr.com/">Flickr</a> or <a href="http://photobucket.com/">Photobucket</a>.</i>  </p>
<p> <strike>Good Luck!</strike> </p>
<p> The contest has ended, and the winner is..... <span class="tx"><b>Andrew Hinde</b>. </span>Nice!<br /> <hints id="hah_hints"> </hints></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/02/25/free-win-a-copy-of-professional-aspnet-20-design-css-themes-and-master-pages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Well Do You Know JavaScript?</title>
		<link>http://adam.kahtava.com/journal/2008/01/13/how-well-do-you-know-javascript/</link>
		<comments>http://adam.kahtava.com/journal/2008/01/13/how-well-do-you-know-javascript/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 19:09:19 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DOM]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[IE]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,b8b02f0d-1ed8-445a-a698-28458ef98622.aspx</guid>
		<description><![CDATA[
JavaScript is probably the world's most popular and misunderstood programming languages and for good reason.
When a developer claims to know JavaScript this generally equates to one or all of the following:

 "I know what JavaScript is, I can learn JavaScript in 30 minutes"
 "JavaScript is for kids, it's a toy language, it's easy"
 "I just [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; padding-left: 5px;"><a href="http://www.flickr.com/photos/matthiasorfield/368716706/"><img src="http://farm1.static.flickr.com/98/368716706_d8c474a12c_m.jpg" alt="" /></a></div>
<p>JavaScript is probably the world's most popular and misunderstood programming languages and for good reason.<br />
When a developer claims to <em>know</em> JavaScript this generally equates to one or all of the following:</p>
<ul>
<li> <em>"I know what JavaScript is, </em><em>I can learn JavaScript in 30 minutes</em><em>"</em></li>
<li> <em>"JavaScript is for kids, it's a toy language, it's easy"</em></li>
<li> <em>"I just copy and paste my JavaScript snippets / scripts from the internet"</em></li>
<li> <em>"JavaScript is just another programming language like C++, C#, VB.NET, or Java"</em></li>
</ul>
<p>If thoughts similar to these have crossed your mind when sizing up your JavaScript knowledge, then you probably don't know JavaScript.</p>
<p>I would argue that if you've never programmed in a <a href="http://en.wikipedia.org/wiki/Functional_programming">functional programming language</a> (like: <a href="http://en.wikipedia.org/wiki/LISP">Lisp</a>, <a href="http://en.wikipedia.org/wiki/Scheme">Scheme</a>, <a href="http://en.wikipedia.org/wiki/F_Sharp_programming_language">F#</a>), never read a <a href="http://adam.kahtava.com/journal/2008/04/16/how-to-choose-a-good-technical-book/"><strong><span style="text-decoration: underline;"><em>GOOD</em></span></strong></a> book on JavaScript, or never watched a video on JavaScript, then you probably don't understand JavaScript at all. JavaScript is starkly different than any other mainstream programming language.</p>
<p>When it comes to JavaScript, if you don't understand the fundamentals then you're only punishing yourself.</p>
<p><strong>Here are some things every JavaScript developer should probably understand:</strong></p>
<ul>
<li> <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a>, <a href="http://en.wikipedia.org/wiki/JavaScript#History_and_naming">Mocha</a>, <a href="http://en.wikipedia.org/wiki/Livescript">LiveScript</a>, <a href="http://en.wikipedia.org/wiki/JScript">JScript</a>, and <a href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a> are all essentially the same.</li>
<li> JavaScript is a prototypically inherited (<a href="http://en.wikipedia.org/wiki/Prototype-based_programming">prototype-based programming</a>) language which is very different than the classically inherited (<a href="http://en.wikipedia.org/wiki/Class-based_programming">class-based programming</a>) languages like C++, Java, and most of the .NET languages - you know the difference between a prototype-based programming and class-based programming language.</li>
<li> JavaScript is a loosely typed language - you know the difference between <a href="http://en.wikipedia.org/wiki/Strongly-typed_programming_language">strongly-typed programming</a> languages and <a href="http://en.wikipedia.org/wiki/Weak_typing">weak-typed</a> or loosely typed languages.</li>
<li> JavaScript is a functional <a href="http://en.wikipedia.org/wiki/Lambda_calculus">lambda</a> language - you understand lambdas and that functions in JavaScript can be lambdas.</li>
<li> JavaScript functions can be defined inside functions, inside functions, inside functions, and so on - you can demonstrate this.</li>
<li> JavaScript uses function scope, has no curly brace <em>'{}'</em> block scope - you understand that this is common attribute of most functional programming languages.</li>
<li> JavaScript has no private, public, protected assessors, no classes, no enums, no structs - you understand that all these language features can be achieved through objects and function closures.</li>
<li> JavaScript is classless, but instead it uses objects as general containers.</li>
<li> JavaScript makes use of garbage collection.</li>
<li> JavaScript uses truthy and falsy values - you understand which values are truth and falsy.</li>
<li> JavaScript makes use of the <em>'nan'</em> (not a number) and <em>'undefined'</em> values - you understand the difference between these values.</li>
<li> JavaScript has pretty good debuggers - you understand how to debug JavaScript from both IE (<a href="http://www.jonathanboutelle.com/mt/archives/2006/01/howto_debug_jav.html">link</a>) and Firefox (<a href="http://www.getfirebug.com/js.html">link</a>).</li>
<li> You appreciate recursion, and understand that recursion is a useful technique in JavaScript.</li>
<li> You understand that JavaScript Namespaces should be used - you understand the importance of namespaces, and know how to create one (<a href="http://adam.kahtava.com/journal/2008/03/17/namespacing-your-javascript/">Namespacing Your JavaScript</a>).</li>
<li> You know how to avoid the <a href="http://www.dynamicsitesolutions.com/javascript/mistakes/">JavaScript pseudo-protocol</a> (<em>&lt;a href="Javascript:alert('hello');"</em>), and appreciate avoiding it.</li>
<li> You know how to avoid embedding DOM Level 0 JavaScript events (<em>&lt;a onclick=''alert('hello');"</em>) in your mark-up / document structure, and appreciate this technique.</li>
<li> You know that JavaScript can make use of two different event models (<a href="http://www.quirksmode.org/js/events_order.html">event capturing and bubbling</a>), but we should only ever make use of bubbling.</li>
<li> You understand what <a href="http://en.wikipedia.org/wiki/JSON">JSON</a> is and how it's used.</li>
<li> You know how to keep you JavaScript, CSS, document structure separate, and appreciate non obtrusive JavaScript.</li>
</ul>
<p>If any of these points seem foreign, then it may be time to learn JavaScript. With all the hype and buzz around Web 2.0 and AJAX it could be a great way to augment your career while broadening your programming language vocabulary.</p>
<p><strong>Great resources for learning more about JavaScript:</strong></p>
<p>Videos:</p>
<ul>
<li> <em>The JavaScript Programming Language</em>: <a href="http://video.yahoo.com/video/play?vid=111593">Part 1</a>, <a href="http://video.yahoo.com/video/play?vid=111594">Part 2</a>, <a href="http://video.yahoo.com/video/play?vid=111595">Part 3</a>, <a href="http://video.yahoo.com/video/play?vid=111596">Part 4</a></li>
<li> <em>An Inconvenient API: The Theory of the DOM</em>: <a href="http://video.yahoo.com/video/play?vid=111582">Part 1</a>, <a href="http://video.yahoo.com/video/play?vid=111583">Part 2</a>, <a href="http://video.yahoo.com/video/play?vid=111584">Part 3</a></li>
<li> <em>Advanced JavaScript:</em> <a href="http://video.yahoo.com/video/play?vid=111585">Part 1</a>, <a href="http://video.yahoo.com/video/play?vid=111586">Part 2</a>, <a href="http://video.yahoo.com/video/play?vid=111587">Part 3</a></li>
<li> <em>JavaScript: The Good Stuff</em>: <a href="http://video.yahoo.com/video/play?vid=630959">Link</a></li>
<li> All these videos are available on the <a href="http://developer.yahoo.com/yui/theater/">YUI Theater</a> - all the videos are great, watch them all!</li>
</ul>
<p>Books:</p>
<ul>
<li> <a href="http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanagan/dp/1565923928/?tag=adamkahtavaap-20&amp;creativeASIN=1565923928">JavaScript: The Definitive Guide by David Flanagan</a></li>
<li> <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742?tag=adamkahtavaap-20&amp;creativeASIN=0596517742">JavaScript: The Good Parts by Douglas Crockford</a></li>
</ul>
<p>Links:</p>
<ul>
<li> <a href="http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript">MDC: A re-introduction to JavaScript</a></li>
<li> <a href="http://javascript.crockford.com/code.html">Code Conventions for the JavaScript Programming Language</a></li>
<li> <a href="http://javascript.crockford.com/javascript.html">JavaScript: The World's Most Misunderstood Programming Language</a></li>
<li> <a href="http://www.odetocode.com/Articles/473.aspx">What ASP.NET Developers Should Know About JavaScript</a></li>
<li> <a href="http://thinkingandmaking.com/entries/63">Best Practices: Implementing JavaScript for rich internet applications</a></li>
<li> <a href="http://icant.co.uk/articles/seven-rules-of-unobtrusive-javascript/">The seven rules of Unobtrusive JavaScript</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/01/13/how-well-do-you-know-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Alberta TechFest 2007 was a success : My highlights</title>
		<link>http://adam.kahtava.com/journal/2007/11/12/alberta-techfest-2007-was-a-success-my-highlights/</link>
		<comments>http://adam.kahtava.com/journal/2007/11/12/alberta-techfest-2007-was-a-success-my-highlights/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 16:33:43 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Calgary]]></category>

		<category><![CDATA[Code Camp]]></category>

		<category><![CDATA[Events]]></category>

		<category><![CDATA[Musings]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,4cf5f476-1491-4a57-bcb4-a554fd0827b6.aspx</guid>
		<description><![CDATA[This past weekend I attended the Alberta TechFest (an event put on by Calgary .Net User Group). TechFest resembled a code camp, but provides more seminars / sessions geared at a higher level. The sessions were geared towards: project management, the big picture of the Agile process, open source alternatives, as well as some in [...]]]></description>
			<content:encoded><![CDATA[<p>This past weekend I attended the <a href="http://www.albertatechfest.com/">Alberta TechFest</a> (an event put on by <a href="http://www.calgaryug.net/dnn/">Calgary .Net User Group</a>). TechFest resembled a <a href="http://calgarycodecamp.com/portal/">code camp</a>, but provides more seminars / sessions geared at a higher level. The sessions were geared towards: project management, the big picture of the Agile process, open source alternatives, as well as some in depth (show me the code type) presentations on <a href="http://en.wikipedia.org/wiki/Mock_object">Mock objects</a> (using <a href="http://www.ayende.com/projects/rhino-mocks.aspx">Rhino Mocks</a>), Microsoft's new <a href="http://windowsclient.net/Acropolis/">Acropolis</a> framework, Test Driven Development (TDD), and Refactoring.</p>
<p><strong>My highlights:</strong></p>
<ul>
<li> The session on <em>Agile Project Planning With User Storie</em>s, and <em>Refactoring Automated Unit Tests Using Test Smells and Patterns</em> presented by Gerard Meszaros. I've been on a couple projects that could be characterized as <a href="http://steve-yegge.blogspot.com/2006/09/good-agile-bad-agile_27.html">"Bad Agile"</a>, so Gerard's presentation hit many chords, one of the comments he made really stuck out. He said something like: <em>"it's not about the Agile process, it's about the results, it's about delivering...don't be dogmatic"</em>. Sure it's obvious, but it's nice to hear it from someone else.Â  I'm currently in the process of purchasing Gerard's book: <em><a href="http://www.amazon.com/dp/0131495054">xUnit Test Patterns: Refactoring Test Code</a></em>.</li>
<li> <em><a href="http://en.wikipedia.org/wiki/Mock_object">Mock objects </a> with <a href="http://www.ayende.com/projects/rhino-mocks.aspx">Rhino Mocks</a></em> was another great session (byÂ <a href="http://shane.jscconsulting.ca">Shane Courtrille</a>). I've been using Rhino Mocks for a couple months now, but there's always so much to learn from someone with more experience.</li>
</ul>
<p>I'm trying to make it a point to attend more of these events in an effort to <a href="http://adam.kahtava.com/journal/2007/03/04/community-keeps-us-grounded-expand-your-community/">expand my community</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/11/12/alberta-techfest-2007-was-a-success-my-highlights/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</title>
		<link>http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/</link>
		<comments>http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 00:49:15 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,cccb1beb-f995-47ca-92ba-137b7d73f082.aspx</guid>
		<description><![CDATA[ASP.NET 2.0 Themes have a couple design flaws, all of which center around the way Themes reference Cascading Style Sheets (CSS). I've been posting Theme and CSS related issues and work arounds as I encountered them, and in one of my first posts I outlined the possibility of using a VirtualPathProvider to ignore the CSS [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0 Themes have a couple design flaws, all of which center around the way Themes reference <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">Cascading Style Sheets (CSS)</a>. I've been posting Theme and CSS related issues and work arounds as I encountered them, and in one of my first posts I outlined the possibility of using a <a href="http://msdn2.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx">VirtualPathProvider</a> to ignore the CSS files within a directory. In this post I share <a href="http://www.linkedin.com/pub/3/703/412">David Marzo's</a> implemented of this solution. This resolution resolves most of the issues surrounding Themes and CSS, and essentially puts the Cascades back into CSS.</p>
<p><strong>The Problem / Question:</strong><br />
ASP.NET 2.0 Themes automatically includes all the Style Sheets (.css files) found in the active Theme (App_Theme) directory into the Head of the rendered document. This severely limits the robust CSS language, and works against the last decade of Cascading Style Sheet progress. For more specific details on the problems with ASP.NET 2.0 Themes start reading the articles found <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">here</a>.</p>
<p><strong>A Solution / Work Around: </strong><br />
Add a custom <a href="http://msdn2.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx">VirtualPathProvider</a> to ignore the Style Sheets (CSS files) found in the App_Theme directory. For more background on this solution see <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">my article</a> and David Ebbo's article titled <a href="http://blogs.msdn.com/davidebb/archive/2005/11/27/overriding-asp-net-combine-behavior-using-a-virtualpathprovider.aspx"> Overriding ASP.NET combine behavior using a VirtualPathProvider</a>.</p>
<p><strong>An example of the problem:</strong></p>
<p><strong></strong><strong>The directory structure:</strong><br />
<strong><img src="http://adam.kahtava.com/journal/images/blog/TPWSAT_Resolution.png" alt="" /></strong><br />
<em>Notice all the Style Sheets (.css files), there are more in the Adapters directory too.</em></p>
<p><strong><span style="text-decoration: underline;">Before</span> including the CustomVirtualPathProvider (code provided below) into the project's build - the XHTML rendered by Themes:</strong></p>
<pre><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"</span> <span style="color: blue;">&gt;</span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">  &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">title</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">The Problems With Themes and Skins in ASP.NET 2.0</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">title</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">    &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">link</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/CSS/Adapters/ChangePassword.css"</span> <span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt; </span></span>

<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: #008000;">    ... The other 17 externally linked Style Sheets go here, they were removed to improve readability ...</span></span>

<span style="color: #008000;"> </span><span style="color: #008000;">    </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">link</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/CSS/PrinterFriendly.css"</span> <span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">  &lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></pre>
<p><em>The Style Sheets are automagically inserted into the Head tag from the active Theme directory. Keep in mind that Internet Explorer has a 30 Style Sheet limitation (see article <a href="http://support.microsoft.com/kb/q262161">Q262161</a>).</em><br />
<strong></strong></p>
<p><strong><span style="text-decoration: underline;">After</span> including the CustomVirtualPathProvider (code provided below) into the project's build - the XHTML rendered by Themes:</strong></p>
<pre><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"</span> <span style="color: blue;">&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">  &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">title</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">The Problems With Themes and Skins in ASP.NET 2.0</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">title</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">  &lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></pre>
<p><em>Notice the complete lack of Style Sheets - ahhh simplicity is bliss, the very foundations of <a href="http://www.csszengarden.com/">CSS Zen Enlightenment</a>... :) Now we can manually include our Style Sheets, use Conditional Comments, and so on.<br />
</em></p>
<p><strong>The source code for the CustomVirtualPathProvider provided by <a href="http://www.linkedin.com/pub/3/703/412">David Marzo</a> in C#:<br />
</strong></p>
<pre><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">namespace</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> Arfila.Web.Logic {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>[<span style="color: teal;">AspNetHostingPermission</span>(<span style="color: teal;">SecurityAction</span>.Demand,
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Level = <span style="color: teal;">AspNetHostingPermissionLevel</span>.Medium)]</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>[<span style="color: teal;">AspNetHostingPermission</span>(<span style="color: teal;">SecurityAction</span>.InheritanceDemand,
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Level = <span style="color: teal;">AspNetHostingPermissionLevel</span>.High)]</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: teal;">CustomVirtualPathProvider</span> : <span style="color: teal;">VirtualPathProvider</span> {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span><span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> AppInitialize() {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>     </span><span style="color: teal;">HostingEnvironment</span>.RegisterVirtualPathProvider(<span style="color: blue;">new</span> <span style="color: teal;">CustomVirtualPathProvider</span>());</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span><span style="color: blue;">public</span> CustomVirtualPathProvider() : <span style="color: blue;">base</span>() { }</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span><span style="color: blue;">private</span> <span style="color: blue;">bool</span> IsThemeDirectory(<span style="color: blue;">string</span> virtualPath) {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span>    </span><span style="color: teal;">String</span> checkPath = <span style="color: teal;">VirtualPathUtility</span>.ToAppRelative(virtualPath);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>     </span><span style="color: blue;">return</span> checkPath.StartsWith(<span style="color: maroon;">"~/App_Themes/"</span>, <span style="color: teal;">
</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: teal;">StringComparison</span>.InvariantCultureIgnoreCase);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span><span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: teal;">VirtualDirectory</span> GetDirectory(<span style="color: blue;">string</span> virtualDir) {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>     </span><span style="color: blue;">if</span> (IsThemeDirectory(virtualDir)) {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>       </span><span style="color: blue;">return</span> <span style="color: blue;">new</span> <span style="color: teal;">ThemeDirectory</span>(Previous.GetDirectory(virtualDir));</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>     </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>     </span><span style="color: blue;">else</span> {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>       </span><span style="color: blue;">return</span> Previous.GetDirectory(virtualDir);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>     </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>   </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>[<span style="color: teal;">AspNetHostingPermission</span>(<span style="color: teal;">SecurityAction</span>.Demand,
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Level = <span style="color: teal;">AspNetHostingPermissionLevel</span>.Minimal)]</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>[<span style="color: teal;">AspNetHostingPermission</span>(<span style="color: teal;">SecurityAction</span>.InheritanceDemand,
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Level = <span style="color: teal;">AspNetHostingPermissionLevel</span>.Minimal)]</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: teal;">ThemeDirectory</span> : <span style="color: teal;">VirtualDirectory</span> {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: teal;">VirtualDirectory</span> _toFilter;</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">private</span> <span style="color: teal;">ArrayList</span> _children = <span style="color: blue;">new</span> <span style="color: teal;">ArrayList</span>();</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">private</span> <span style="color: teal;">ArrayList</span> _directories = <span style="color: blue;">new</span> <span style="color: teal;">ArrayList</span>();</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">private</span> <span style="color: teal;">ArrayList</span> _files = <span style="color: blue;">new</span> <span style="color: teal;">ArrayList</span>();</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: teal;">IEnumerable</span> Children {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span><span style="color: blue;">get</span> { <span style="color: blue;">return</span> _children; }</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: teal;">IEnumerable</span> Directories {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span><span style="color: blue;">get</span> { <span style="color: blue;">return</span> _directories; }</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: teal;">IEnumerable</span> Files {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span><span style="color: blue;">get</span> { <span style="color: blue;">return</span> _files; }</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">public</span> ThemeDirectory(<span style="color: teal;">VirtualDirectory</span> toFilter) : <span style="color: blue;">base</span>(toFilter.VirtualPath) {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span>_toFilter = toFilter;</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span>BuildChild();</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span><span style="color: blue;">private</span> <span style="color: blue;">void</span> BuildChild() {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span><span style="color: blue;">foreach</span> (<span style="color: teal;">VirtualDirectory</span> dirToFilter <span style="color: blue;">in</span> _toFilter.Directories) {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span><span style="color: teal;">ThemeDirectory</span> themeDir = <span style="color: blue;">new</span> <span style="color: teal;">ThemeDirectory</span>(dirToFilter);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span>_children.Add(themeDir);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span>_directories.Add(themeDir);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span><span style="color: blue;">foreach</span> (<span style="color: teal;">VirtualFile</span> fileToFilter <span style="color: blue;">in</span> _toFilter.Files) {
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span><span style="color: blue;">string</span> fileExtension = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: teal;">VirtualPathUtility</span>.GetExtension(fileToFilter.VirtualPath).TrimStart(<span style="color: maroon;">'.'</span>);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>  </span><span>      </span><span style="color: blue;">if</span> (<span style="color: blue;">string</span>.Compare(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">fileExtension</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">, <span style="color: maroon;">"css"</span>, <span style="color: blue;">true</span>) != 0) {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>          </span>_children.Add(fileToFilter);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>          </span>_files.Add(fileToFilter);</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span><span style="color: blue;">else</span> {</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>          </span><span style="color: green;">//archivo .css no incluir</span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>        </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>      </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>    </span>}</span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>  </span>}
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">}</span></pre>
<p><em>Some of the code has been modified for readability, download the original source code <a href="http://adamdotcom-script.googlecode.com/svn/trunk/Etcetera/CustomVirtualPathProvider.cs">here</a>.</em></p>
<p><strong>Note:</strong><em> In order to use this VPP you'll have to copy the code above into a new class in your App_Code directory.</em></p>
<div style="border: 1px solid #ccccee; padding: 5px; background-color: #ffffdd;"><strong>Caveat: </strong><em>If a Web site is precompiled for deployment, content provided by a VirtualPathProvider instance is not compiled, and no VirtualPathProvider instances are used by the precompiled site.</em> - Taken from the article titled <a href="http://msdn2.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx">VirtualPathProvider Class</a> on MSDN.</div>
<p><strong><br />
Conclusion:</strong> This is one of the nicest work arounds or resolution to the issues surrounding ASP.NET 2.0 Themes. It allows us to leverage the power of ASP.NET 2.0 default Skins, allows us to logically group design related resources (Style Sheets, images, default Skins, videos, etc...) in the App_Theme directory, allows us to control the loading order (cascades) of style sheets, allows us to use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Conditional Comments</a>, to define <a href="http://www.w3.org/TR/REC-CSS2/media.html">Media Types</a>, to override / inherit Styles, and to continue using CSS as it's intended. In addition we can now easily integrate the <a href="http://www.asp.net/cssadapters/">ASP.NET 2.0 CSS Friendly Control Adapters</a> into our web applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/feed/</wfw:commentRss>
		</item>
		<item>
		<title>In Favor of Using Style Elements / Embedded Style Sheets / Style Blocks / Style Tags or Whatever You Want To Call Them inside the HTML / XHTML Body.</title>
		<link>http://adam.kahtava.com/journal/2007/03/20/in-favor-of-using-style-elements-embedded-style-sheets-style-blocks-style-tags-or-whatever-you-want-to-call-them-inside-the-html-xhtml-body/</link>
		<comments>http://adam.kahtava.com/journal/2007/03/20/in-favor-of-using-style-elements-embedded-style-sheets-style-blocks-style-tags-or-whatever-you-want-to-call-them-inside-the-html-xhtml-body/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 22:20:02 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DOM]]></category>

		<category><![CDATA[Firebug]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[IE]]></category>

		<category><![CDATA[Opera]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,fb97f8d5-0271-466f-a3f3-e09c53890ab0.aspx</guid>
		<description><![CDATA[I've been using Style Elements within the HTML Body tag to work around some of the design flaws presented in ASP.NET 2.0 Themes - see the second solution in this post for more details. I've been leary of using this method because it's not a best practice, since it compromises the validity of the HTML [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using <a href="http://www.w3.org/TR/REC-CSS1#containment-in-html">Style Elements</a> within the HTML Body tag to work around some of the design flaws presented in ASP.NET 2.0 Themes - see the second solution in <a href="http://adam.kahtava.com/journal/c1575144-e460-464d-b993-259ce96135f4.aspx">this post</a> for more details. I've been leary of using this method because it's not a best practice, since it compromises the validity of the HTML / XHTML document. I decided to do a little more research on this subject and made the following discoveries.</p>
<p><strong>Discoveries:</strong></p>
<ol>
<li> Some of the more complex web sites (<a href="http://amazon.com/">Amazon</a> and <a href="http://www.yahoo.com/">Yahoo!</a>) make use of Style Elements within the Body Element - see the source snippets below.</li>
<li> <a href="http://en.wikipedia.org/wiki/Gecko_%28layout_engine%29">Gecko</a> (<a href="http://en.wikipedia.org/wiki/Firefox">Firefox</a>, <a href="http://en.wikipedia.org/wiki/Flock_%28web_browser%29">Flock</a>, <a href="http://en.wikipedia.org/wiki/Mozilla">Mozilla</a>, etc...) based browsers automatically move Style Elements found within the Body Element into the Head Element and render the page as expected - see the rendered Document Object Model (DOM) image below.</li>
<li> <a href="http://en.wikipedia.org/wiki/Internet_Explorer">Internet Explorer</a> doesn't move the Style Element into the Head Element, but renders the page as expected.</li>
<li> <a href="http://en.wikipedia.org/wiki/Opera_%28internet_suite%29">Opera</a>... well I wish I knew what Opera did, but the page renders as expected.</li>
</ol>
<p><strong>Source snippet from Amazon:</strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><br />
</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">table</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>Â Â Â  </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">td</span><span style="color: blue;">&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>Â  </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">tr</span><span style="color: blue;">&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">table</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;Â </p>
<p><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">type</span><span style="color: blue;">="text/css"&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">.lol-hr-center</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> { <span style="color: red;">margin</span>: <span style="color: blue;">5px</span>; <span style="color: red;">border-top-width</span>: <span style="color: blue;">1px</span>; </span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">/* and so on... */</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">}</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></strong></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">div</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">id</span><span style="color: blue;">="listoflists_data"</span> <span style="color: red;">style</span><span style="color: blue;">="display:none"&gt; </span></span><br />
<em>Note how the Style element is located between the &lt;table&gt; and &lt;div&gt; tags.</em></p>
<p></span><br />
<strong>Source snippet from Yahoo!:</strong></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">h4</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">a</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">id</span><span style="color: blue;">="paweather"</span> <span style="color: red;">class</span><span style="color: blue;">="details"</span> <span style="color: red;">href</span><span style="color: blue;">="r/wb/*-http://weather.yahoo.com/forecast/USKS0448_f.html"&gt;&lt;</span><span style="color: maroon;">span</span> <span style="color: red;">class</span><span style="color: blue;">="icon"&gt;</span>Weather <span style="color: blue;">&lt;</span><span style="color: maroon;">b</span><span style="color: blue;">&gt;&lt;</span><span style="color: maroon;">strong</span><span style="color: blue;">&gt;</span>51<span style="color: red;">&amp;deg;</span><span style="color: blue;">&lt;/</span><span style="color: maroon;">strong</span><span style="color: blue;">&gt;</span>F<span style="color: blue;">&lt;/</span><span style="color: maroon;">b</span><span style="color: blue;">&gt;&lt;/</span><span style="color: maroon;">span</span><span style="color: blue;">&gt;&lt;/</span><span style="color: maroon;">a</span><span style="color: blue;">&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong>&lt;</strong></span><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span></strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong> <span style="color: red;">type</span><span style="color: blue;">="text/css"&gt;</span><span style="color: maroon;">#patabs</span> <span style="color: maroon;">#weather</span> <span style="color: maroon;">.icon</span>{<span style="color: red;">background</span>:<span style="color: blue;">url(http://us.i1.yimg.com/us.yimg.com/i/us/we/31/b/26.gif)</span> <span style="color: blue;">3px</span> <span style="color: blue;">2px</span><span style="color: blue;">no-repeat</span>;}<span style="color: blue;">&lt;/</span><span style="color: maroon;">style</span><span style="color: blue;">&gt;</span></strong></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong></strong>&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">h4</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><br />
<em>Note how the Style element is located within the &lt;h4&gt; tag.</em><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> </span><br />
<strong>A snapshot of the <a href="http://en.wikipedia.org/wiki/Document_Object_Model">Document Object Model (DOM)</a> as seen through <a href="http://www.getfirebug.com/">Firebug</a>:</strong></p>
<blockquote><p><img src="http://adam.kahtava.com/journal/images/blog/StyleInBody1.png" alt="" /><br />
<em>Note the highlighted area references the Yahoo! source snippet from above.</em>Â<br />
<strong>Conclusion:</strong> Although the Style Element within the Body Element compromises the validity of a document, some of the leaders in web design and accessibility use this approach, so it may not be as big a work around or hack.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/03/20/in-favor-of-using-style-elements-embedded-style-sheets-style-blocks-style-tags-or-whatever-you-want-to-call-them-inside-the-html-xhtml-body/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Code Camp in Toronto, are you going?</title>
		<link>http://adam.kahtava.com/journal/2007/03/14/code-camp-in-toronto-are-you-going/</link>
		<comments>http://adam.kahtava.com/journal/2007/03/14/code-camp-in-toronto-are-you-going/#comments</comments>
		<pubDate>Wed, 14 Mar 2007 22:36:29 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Code Camp]]></category>

		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,97a5ffc5-cde1-4572-b91f-0a12108065fb.aspx</guid>
		<description><![CDATA[
 So what is Code Camp all about?
 A Code Camp must follow these rules: 

 By and For the Developer Community - Code Camps are about the developer community at large. They are meant to be a place for developers to come and learn from their peers. Topics are always based on community interest [...]]]></description>
			<content:encoded><![CDATA[</p>
<p> <b>So what is Code Camp all about?</p>
<p> A Code Camp must follow these rules:<br /> </b>
<ol>
<li> <b>By and For the Developer Community</b> - Code Camps are about the developer community at large. They are meant to be a place for developers to come and learn from their peers. Topics are always based on community interest and never determined by anyone other than the community.</li>
<li> <b>Always Free</b> - Code Camps are always free for attendees.</li>
<li> <b>Community Developed Material</b> - The success of the Code Camps is that they are based on community content. All content that is delivered is original. All presentation content must be provided completely (including code) without any restriction. If you have content you don&#39;t want to share or provide to attendees then the Code Camp is not the place for you.</li>
<li> <b>No Fluff</b> &#95; only Code - Code Camps are about showing the code. Refer to rule #1 if you have any questions on this.</li>
<li> <b>Community Ownership</b> - The most important element of the Code Camp is always the developer community. All are welcome to attend and speak and do so without expectation of payment or any other compensation other than their participation in the community.</li>
<li> <b>Never occur during work hours</b> - We understand that many times people can&#39;t leave work for a day or two to attend training or even seminars. The beauty of the Code Camp is that they always occur on weekends.</li>
</ol>
<p> Read more here: <a href="http://www.torontocodecamp.net/">http://www.torontocodecamp.net/</a> </p>
<p> If your attending then I&#39;ll see you there. :)<hints id="hah_hints"> </hints></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/03/14/code-camp-in-toronto-are-you-going/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Problems with Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 - Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</title>
		<link>http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/</link>
		<comments>http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/#comments</comments>
		<pubDate>Sun, 25 Feb 2007 15:19:12 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,002ae3f5-6496-4d64-aab8-d3ccf498d7c7.aspx</guid>
		<description><![CDATA[In this post I outline a couple alternate ways of defining the CSS Print Media Type with Themes. ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Style Sheets (CSS), but don't fully support CSS - I've listed some "Work Arounds" for a couple [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I outline a couple alternate ways of defining the CSS Print <a href="http://www.w3.org/TR/REC-CSS2/media.html">Media Type</a> with Themes. ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on <a href="http://en.wikipedia.org/wiki/Css">Cascading Style Sheets (CSS)</a>, but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your application is even developed, instead I suggest sticking with CSS and perhaps using some default Skins that define CSS selectors like classes or IDs.</p>
<p><strong>The Problem / Question:</strong><br />
How can I use the CSS Print <a href="http://www.w3.org/TR/REC-CSS2/media.html">Media Type</a> with Themes? In the past I've used an <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.1">External Style Sheet</a> which defined the Print Media Type, but ASP.NET 2.0 omits the Media Type attribute when it automatically includes all my CSS files (from the active Theme directory) into the HTML Head tag.</p>
<p><strong>A Solution / Work Around:</strong><br />
The Print Media Type isn't constrained to External Style Sheets and can be defined in the <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.2.3">Style Element</a>, in the <a href="http://www.w3.org/TR/CSS21/media.html#at-media-rule">@Media rule</a>, and even specified through the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">@Import rule</a>.</p>
<p><strong>An example of the problem:</strong></p>
<p><strong></strong><strong>The directory structure:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_5_VS05_SS1.png" alt="" /></p>
<p><strong>The rendered XHTML: </strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0<span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=<span style="color: #0000ff;">"App_Themes/Default/PrinterFriendlyStyleSheet.css"</span></span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=<span style="color: #0000ff;">"App_Themes/Default/StyleSheet.css"</span></span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><br />
<em>Note each externally linked Style Sheet lacks a media type.</em></p>
<p><strong>Our desired XHTML (using an Externally Linked Style Sheet and a Print Media Type) would have looked something like this: </strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=<span style="color: #0000ff;">"App_Themes/Default/PrinterFriendlyStyleSheet.css"</span></span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: red;">media</span><span style="color: blue;">="all"</span><strong><span style="color: blue;"> </span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span>/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/PrinterFriendlyStyleSheet.css"</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <strong><span style="color: red;">media</span><span style="color: blue;">="print"</span></strong> <span>/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><br />
<em>Note the Media Type (<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong><span style="color: red;">media</span><span style="color: blue;">="print"</span></strong></span>) in bold.</em></p>
<p><strong> The solutions:</strong></p>
<p><strong></strong><strong>Option 1. </strong>Use the <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">Media Rule (@Media)</a> to define the print <a href="http://www.w3.org/TR/REC-CSS2/media.html#media-types">Media Type</a> inside an <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.3">Externally Linked</a> Style Sheet.</p>
<p><strong>An example:</strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">@Media</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> Print {</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: maroon;">body</span> {</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">background-color</span>: <span style="color: blue;">#FFFFFF</span>;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>}</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: green;">/*... your CSS here ...*/</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: maroon;">#Menu</span>, <span style="color: maroon;">#AdvertismentContainer</span> {</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">display</span>: <span style="color: blue;">none</span>;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>}</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: maroon;">#Content</span> {</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">width</span>: <span style="color: blue;">100%</span>;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span>}</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">}</span><br />
<strong>Discussion:</strong> This is probably the best alternative to defining the Media Type in an Externally Linked Style Sheet - the other solutions introduce problems of their own.<br />
<strong></strong></p>
<p><strong>Option 2. </strong>Use the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">Import Rule (@Import)</a> to load your printer friendly Style Sheet from an alternate location and define a <a href="http://www.w3.org/TR/REC-CSS2/media.html#media-types">Media Type</a> - this involves removing your printer friendly Style Sheet from the Themes (App_Theme directory).</p>
<p><strong>An example:</strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">@Import</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> url("/AppName/CSS/PrinterFriendlyStyleSheet.css") Print;</span></p>
<p><strong>Discussion:</strong> This solution requires moving our Printer Friendly Style Sheet outside the Theme directory, since Themes don't allow us to exclude a Style Sheet folder (see <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder</a> for more details). Once we start moving Style Sheets outside the Themes directory we should probably ask ourselves why we're even using Themes, and consider regaining complete control over our CSS by moving all the CSS files outside the Theme directory. At this point we could revert to Externally Linking our Style Sheets where we could define our Media Type attributes. In addition the CSS <a href="http://www.w3.org/TR/REC-CSS1#url">URL function</a> used in this solution confuses many.<br />
<strong></strong></p>
<p><strong>Option 3. </strong>Use the <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.2.3">Style Element</a> to define a Print <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.2.4">Media Type</a>.</p>
<p><strong>An example:</strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">media</span><span>=<span style="color: #0000ff;">"print"</span>&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: green;">/*... your CSS here ...*/</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span>&gt;</p>
<p><strong>Discussion:</strong> This solution doesn't work if the <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.2.3">Style Elements</a> are defined in the HTML head (see <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style Sheets with Themes</a> for more details), you can however move the Style Element into the Body of the document, this compromises the HTML validation, but large e-commerce sites like <a href="http://amazon.com/">Amazon</a> and <a href="http://www.yahoo.com/">Yahoo!</a> make heavy use of this method.</p>
<p><strong>Option 4. </strong>Sub class the <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlhead_members.aspx">HtmlHead class</a> to enumerate through the child controls and add new Meta attributes to the child controls using the <a href="http://msdn2.microsoft.com/en-US/library/system.web.ui.htmlcontrols.htmllink_properties.aspx">HtmlLink class</a>. See my post titled <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s)</a> for more details.<br />
<strong>Discussion:</strong> This solution requires a fair amount of work and only solves one of the many problems with Themes, pursuing this solution would probably be a case of <a href="http://www.answers.com/topic/can-t-see-the-forest-for-the-trees">not seeing the forest for the trees</a>.</p>
<p><strong>In conclusion;</strong> Themes are a nice addition to ASP.NET, but have some significant design flaws particularly in the way it uses CSS - in this case how printer friendly (print) CSS Media Types are defined. I wouldn't recommend using Themes on a complex web applications that make heavy use of CSS or AJAX, but for small projects they may be a nice option.</p>
<p><strong>Related links:</strong></p>
<ul>
<li> <a href="http://alistapart.com/articles/goingtoprint/">CSS Design: Going to Print</a></li>
<li> <a href="http://alistapart.com/articles/boom">Printing a Book with CSS: Boom!</a></li>
<li> <a href="http://www.tufts.edu/webcentral/tutorials/printcss/">A Print CSS Primer</a></li>
<li> <a href="http://webdesign.about.com/cs/css/a/aa042103a.htm">CSS Media Types Create Print-Friendly Pages</a></li>
</ul>
<p><strong>Related posts:</strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">Where it all Falls Apart</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder (Work Around #1)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s) (Work Around #2)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/">Defining the Load Order (Cascades) for CSS (Work Around #3)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style with Themes (Work Around #4)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Problems with Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 - Using Internal (Embedded) Style Sheets with Themes (Work Around #4)</title>
		<link>http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/</link>
		<comments>http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 18:44:36 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,c1575144-e460-464d-b993-259ce96135f4.aspx</guid>
		<description><![CDATA[ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on <a href="http://en.wikipedia.org/wiki/Css">Cascading Stye Sheet (CSS)</a>, but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your application is even developed, instead I suggest sticking with CSS and perhaps using some default Skins that define CSS selectors like classes or IDs.</p>
<p><strong>The Problem / Question:</strong><br />
How can I add Internal (embedded) style sheets (the ones that use the <a href="http://www.w3.org/TR/2004/WD-xhtml2-20040722/mod-styleSheet.html#sec_25.1.">Style element)</a> inside the Head tag when using Master Pages and Themes?Â  How can I override (overload) <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.3">External style sheets</a> for local pages or specific Web User Controls?</p>
<p><strong>A Solution / Work Around:</strong></p>
<p>One option is to create an ASP Placeholder (<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">asp</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">:</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">contentplaceholder</span>) in the Master Page's Head tag to add the Style element into the Head of your Web Form (.aspx page). However, this solution doesn't work well when using Themes, since themes automatically include the External style sheets after the Style element - I demonstrate this and provide an alternative solution later on in this post.</p>
<p><strong>The Caveat / Warnings:</strong><br />
In most current-generation browsers the loading order for Internal style sheets, and External style sheets depend on their position in the Head tag. This behavior seems to go against what the W3C intended.</p>
<blockquote><p><em>Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:<br />
</em></p>
<ol>
<li> <em>Browser default</em></li>
<li> <em>External style sheet</em></li>
<li> <em>Internal style sheet (inside the &lt;head&gt; tag)</em></li>
<li> <em>Inline style (inside an HTML element)</em></li>
</ol>
<p><em>- Taken from: <a href="http://www.w3schools.com/css/css_intro.asp">http://www.w3schools.com/css/css_intro.asp</a></em></p></blockquote>
<p>As I understand and as the w3schools point out (I can't find a reference from the depths of the <a href="http://www.w3.org/Style/CSS/">W3C</a>), Internal style sheets should have a higher priority than External style sheets, unfortunately this isn't the reality. Instead External style sheets and Internal style sheets depend on the loading (cascading) order. An Internal style sheet will only override an External style sheet (in current-generation browsers) if the External style sheet is loaded first. This behavior introduces problems when using an ASP Placeholder because ASP.NET automatically includes the Style Sheets (.css) from the active Theme (App_Theme) directories into the Head tag after the ASP Placeholder's contents have been loaded.</p>
<p><strong>An example of the problem:</strong></p>
<p><strong>The directory structure:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_4_VS05_SS1.png" alt="" /></p>
<p class="MsoNormal"><strong>The active Master Page: </strong><br />
<span style="background: yellow none repeat scroll 0% 50%; font-size: 10pt; font-family: &quot;Courier New&quot;; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;%</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">@</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: maroon;">Master</span> <span style="color: red;">Language</span><span style="color: blue;">="C#"</span> <span style="color: red;">EnableTheming</span><span style="color: blue;">="true"</span> <span style="color: red;">AutoEventWireup</span><span style="color: red;">="true"<br />
CodeFile</span><span style="color: blue;">="MasterPage.master.cs"</span> <span style="color: red;">Inherits</span><span style="color: blue;">="MasterPage"</span> <span style="background: yellow none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">%&gt;</span></span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;!</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">DOCTYPE</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">html</span> <span style="color: red;">PUBLIC</span> <span style="color: blue;">"-//W3C//DTD XHTML 1.0 Transitional//EN"</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: blue;">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"</span> <span style="color: blue;">&gt;</span><br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">runat</span><span>="server"&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0<span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;</span></span></p>
<p class="MsoNormal"><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">contentplaceholder</span> <span style="color: red;">id</span><span style="color: blue;">="ContentPlaceHolderHead"</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: blue;">/&gt;</span></span></strong></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">form</span> <span style="color: red;">id</span><span style="color: blue;">="form1"</span> <span style="color: red;">runat</span><span>="server"&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><strong><span style="color: blue;">&lt;</span><span style="color: maroon;">h1</span><span style="color: blue;">&gt;</span>Hello World!<span style="color: blue;">&lt;/</span><span style="color: maroon;">h1</span></strong><span><strong>&gt;</strong></span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">form</span><span style="color: blue;">&gt;</span><br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><em><br />
Note: the ASP Content Place Holder between the Head tags and "Hello World!" between the H1 tags.</em></p>
<p class="MsoNormal"><strong>The default Web Form (.aspx page) providing the Content for the Master Page's Content Place Holder:</strong><br />
<span style="background: yellow none repeat scroll 0% 50%; font-size: 10pt; font-family: &quot;Courier New&quot;; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;%</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">@</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: maroon;">Page</span> <span style="color: red;">Language</span><span style="color: blue;">="C#"</span> <span style="color: red;">Theme</span><span style="color: blue;">="Default"</span> <span style="color: red;">MasterPageFile</span><span style="color: red;">=<span style="color: #0000ff;">"~/MasterPage.master"</span><br />
AutoEventWireup</span><span style="color: blue;">="true"</span> <span style="color: red;">CodeFile</span><span style="color: blue;">="Default.aspx.cs"</span> <span style="color: red;">Inherits</span><span style="color: blue;">="Default"</span> <span style="background: yellow none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">%&gt; </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">asp</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">:</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">Content</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">ID</span><span style="color: blue;">="Content1"</span> <span style="color: red;">ContentPlaceHolderID</span><span style="color: blue;">="ContentPlaceHolderHead"</span> <span style="color: red;">Runat</span><span>=<span style="color: #0000ff;">"Server"</span>&gt;</span></span></p>
<p class="MsoNormal"><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">style</span> <span style="color: red;">type</span><span>="text/css"&gt;<br />
</span><span style="color: maroon;">H1</span>{<br />
<span> </span><span style="color: red;">color</span>: <span style="color: blue;">red</span>;<br />
<span> </span>}<br />
<span> </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">style</span><span style="color: blue;">&gt;</span></span></strong></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">asp</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">:</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">Content</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><em><br />
Note: the Style element between the ASP Content Place Holder tag - H1 should now be colored red.</em></p>
<p class="MsoNormal"><strong>The contents of StyleSheet.css, the only CSS file in the Active Theme (App_Theme) directory:</strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">H1</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">{<br />
<span> </span><strong><span style="color: red;">color</span>: <span style="color: blue;">blue</span>;</strong><br />
}</span><br />
<em>Note: H1 should still be red because Internal style sheets are supposed to have priority over External style sheets.</em><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>
<p class="MsoNormal"><strong>The rendered XHTML:</strong><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;!</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">DOCTYPE</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">html</span> <span style="color: red;">PUBLIC</span> <span style="color: blue;">"-//W3C//DTD XHTML 1.0 Transitional//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"</span> <span style="color: blue;">&gt;</span><br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0<span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span><strong> </strong></span><strong><span style="color: blue;">&lt;</span><span style="color: maroon;">style</span> <span style="color: red;">type</span><span>="text/css"&gt;<br />
</span><span style="color: maroon;">H1</span>{<br />
<span> </span><span style="color: red;">color</span>: <span style="color: blue;">red</span>;<br />
<span> </span>}<br />
<span> </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">style</span></strong><span><strong>&gt;</strong> </span></span></p>
<p><strong><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheet.css"</span> <span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></strong></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">form</span> <span style="color: red;">name</span><span style="color: blue;">="aspnetForm"</span> <span style="color: red;">method</span><span style="color: blue;">="post"</span> <span style="color: red;">action</span><span style="color: blue;">="Default.aspx"</span> <span style="color: red;">id</span><span>="aspnetForm"&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">div</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">input</span> <span style="color: red;">type</span><span style="color: blue;">="hidden"</span> <span style="color: red;">name</span><span style="color: blue;">="__VIEWSTATE"</span> <span style="color: red;">id</span><span style="color: blue;">="__VIEWSTATE"</span> <span style="color: red;">value</span><span style="color: blue;">="..."</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;/</span><span style="color: maroon;">div</span><span>&gt;</span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span><strong> </strong></span><strong><span style="color: blue;">&lt;</span><span style="color: maroon;">h1</span><span style="color: blue;">&gt;</span>Hello World!<span style="color: blue;">&lt;/</span><span style="color: maroon;">h1</span></strong><span><strong>&gt;</strong></span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">form</span><span style="color: blue;">&gt;</span><br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><em><br />
Note: the position of the External Style Sheet (the Link element) in relation to the Internal Style Sheet (the Style element) - the Internal style definition (</em><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong></strong><span style="color: red;">color</span>: <span style="color: blue;">red</span>;</span><em>) precedes the External style definition (</em><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: red;">color</span>: <span style="color: blue;">blue</span>;</span><em>). </em></p>
<p><strong>The results in a web browser:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_4_FF_SS1.png" alt="" /><br />
<em>Note: according to the style sheet priorities in the W3C guidelines (see above) "Hello World!" should be colored red not blue - the Internal Style should be applied before the External Style; however, this is not the case.</em><br />
<strong>Conclusion;</strong> the ASP Content Place Holder "Work Around" doesn't work well with Themes since ASP.NET automatically includes all the CSS files in the active Theme directory - this behavior disrupts the loading (cascading) orders. This "Work Around" could be useful if you were only using Master Pages or were painfully meticulous with your CSS names and made heavy use of the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#important-rules"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">!important</span></a> style definition.</p>
<p><strong>Another Solution / Another Work Around:</strong><br />
Define the Style element outside the Head tag, directly within the content of your page.<strong> </strong></p>
<p><strong> An example of the Work Around:</strong><br />
<strong>The rendered XHTML:<br />
</strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;!</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">DOCTYPE</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">html</span> <span style="color: red;">PUBLIC</span> <span style="color: blue;">"-//W3C//DTD XHTML 1.0 Transitional//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</span><br />
</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"</span> <span style="color: blue;">&gt;</span><br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0<span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">style</span> <span style="color: red;">type</span><span>="text/css"&gt;<br />
</span><span style="color: maroon;">H1</span>{<br />
<span> </span><span style="color: red;">color</span>: <span style="color: blue;">red</span>;<br />
<span> </span>}<br />
<span> </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">style</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheet.css"</span> <span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span><br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">style</span> <span style="color: red;">type</span><span>="text/css" </span></strong></span><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">media</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">="screen"</span></strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><strong><span>&gt;<br />
</span><span style="color: maroon;">H1</span>{<br />
<span> </span><span style="color: red;">color</span>: <span style="color: blue;">green</span>;<br />
<span> </span>}<br />
<span> </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">style</span></strong><span><strong>&gt;</strong></span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">form</span> <span style="color: red;">name</span><span style="color: blue;">="aspnetForm"</span> <span style="color: red;">method</span><span style="color: blue;">="post"</span> <span style="color: red;">action</span><span style="color: blue;">="Default.aspx"</span> <span style="color: red;">id</span><span>="aspnetForm"&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">div</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">input</span> <span style="color: red;">type</span><span style="color: blue;">="hidden"</span> <span style="color: red;">name</span><span style="color: blue;">="__VIEWSTATE"</span> <span style="color: red;">id</span><span style="color: blue;">="__VIEWSTATE"</span> <span style="color: red;">value</span><span style="color: blue;">="..."</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;/</span><span style="color: maroon;">div</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">h1</span><span style="color: blue;">&gt;</span>Hello World!<span style="color: blue;">&lt;/</span><span style="color: maroon;">h1</span><span>&gt;<br />
</span><span style="color: blue;">&lt;/</span><span style="color: maroon;">form</span><span style="color: blue;">&gt;</span><br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">body</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
</span><em>Note: the Style element (</em><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: red;">color</span>: <span style="color: blue;">green</span>;</span><em>)inside the Body tag.</em></p>
<p><strong> The results in a web browser:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_4_FF_SS2.png" alt="" /><br />
<em>Note: "Hello World!" is green as expected.</em><br />
<strong>The Pros and Cons to this (the Style element outside the Head tag) approach:</strong><br />
<strong>Cons:</strong></p>
<ol>
<li> It's not a recommended best practice, but is used by some of the larger sites like <a href="http://amazon.com/">Amazon</a> and <a href="http://www.yahoo.com">Yahoo!</a></li>
<li> It's not valid <a href="http://en.wikipedia.org/wiki/XHTML">XHTML</a> (but neither are iframes in <a href="http://www.w3.org/TR/xhtml1/#strict">XHTML Strict</a>)</li>
</ol>
<p><strong>Pros:</strong></p>
<ol>
<li> Can use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Microsoft's Conditional Comments</a></li>
<li> Can use the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">CSS @Import rule</a></li>
<li> Can use the <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">CSS @Media rule</a></li>
<li> Can use multiple <a href="http://www.w3.org/TR/REC-CSS2/media.html">CSS Media types</a></li>
<li> Can easily use <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.1">Media-dependent cascades</a></li>
<li> Can easily control the CSS load order (<a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.2">inheritance and cascading</a>)</li>
<li> It's fairly intuitive and understandable</li>
<li> It's compatible with Revision Control Systems</li>
</ol>
<p><strong>Conclusion;</strong> Themes are a nice addition to ASP.NET, but have some significant design flaws particularly in the way it uses CSS. Themes aren't recommended for complex web applications that make heavy use of CSS, but for small projects they may be a nice option.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">Where it all Falls Apart</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder (Work Around #1)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s) (Work Around #2)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/">Defining the Load Order (Cascades) for CSS (Work Around #3)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/">Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Problems with Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 - Defining the Load Order (Cascades) for CSS (Work Around #3)</title>
		<link>http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/</link>
		<comments>http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/#comments</comments>
		<pubDate>Sat, 03 Feb 2007 19:30:21 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,003772b4-6ef1-4a6c-ba46-f122c787a052.aspx</guid>
		<description><![CDATA[ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on <a href="http://en.wikipedia.org/wiki/Css">Cascading Stye Sheet (CSS)</a>, but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your application is even developed, instead I suggest sticking with CSS and perhaps using some default Skins that define CSS selectors like classes or IDs.</p>
<p><strong>The Problem / Question:</strong><br />
Is it possible to define the loading order (<a href="http://www.w3.org/TR/REC-CSS2/cascade.html#cascade">cascades</a>) of CSS files while using Themes in ASP.NET 2.0?</p>
<p><strong>The Solutions / Work Arounds:</strong><br />
Order your CSS files alphanumerically - ASP.NET 2.0 parses through the active Theme directory and all sub directories alphanumerically including every CSS file into the HTML head (via an <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.3">external link</a>) of the rendered page.</p>
<p><strong>An example of the problem (when load order isn't defined).<br />
</strong><em>Note: both examples use the same CSS files, but use different loading orders.</em></p>
<p><strong>The directory structure and StyleSheets:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_3_VS05_SS1.png" alt="" /></p>
<p class="MsoNormal"><strong>The rendered XHTML:</strong><br />
<span style="font-size: xx-small;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"&gt;</span><br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0 <span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/Controls/<strong>OverloadedUserWebControlStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/Controls/<strong>ReusedUserWebControlStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/<strong>OverloadedStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/<strong>ReusedStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span><br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></span></p>
<p><strong>The results in a web browser:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_3_IE_SS1.png" alt="" /></p>
<p><strong><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">An example of the problem (when load order has been defined alphanumerically).</span></strong></p>
<p><strong>The directory structure and StyleSheets:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_3_VS05_SS2.png" alt="" /><br />
<em>Note: the use of alphanumeric delimiters preceding the Style Sheet names.</em></p>
<p class="MsoNormal"><strong>The rendered XHTML:</strong><br />
<span style="font-size: xx-small;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">html</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: red;">xmlns</span><span style="color: blue;">="http://www.w3.org/1999/xhtml"&gt; </span><br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0 <span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/<strong>aa_ReusedStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/Controls/<strong>01_ReusedUserWebControlStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/Controls/<strong>09_OverloadedUserWebControlStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>="App_Themes/Default/<strong>zz_OverloadedStyleSheet.css</strong>"<br />
</span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt;</span><span style="color: blue;"> </span><br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></span><br />
<em>Note: the ordering of the CSS files.</em></p>
<p>The results in a web browser:<br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_3_IE_SS2.png" alt="" /></p>
<p><strong> Comparing the web browser results:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_3_IE_SS1.png" alt="" /> <img src="http://adam.kahtava.com/journal/images/blog/TPWTAS_3_IE_SS2.png" alt="" /><br />
<strong>The Pros and Cons to this approach:</strong></p>
<p><strong>Cons:</strong></p>
<ol>
<li> Being a work around it's not intuitive _ a maintenance programmers nightmare - "I'm familiar with CSS, but how are the Cascading Style Sheets being loaded??"</li>
<li> Contributes to a fragile environment - the way ASP.NET parses through the App_Themes directories may change in newer versions of ASP.NET, not to mention changing a filename could have negative side effects on the site's design.</li>
</ol>
<p><strong>Pros:</strong></p>
<ol>
<li> Allows a load order to be defined</li>
<li> Compatible with <a href="http://en.wikipedia.org/wiki/Version_control">Revision Control Systems</a></li>
</ol>
<p><strong>In conclusion;</strong> Themes are a nice addition to ASP.NET, but have some significant design flaws particularly in the way it uses CSS. Themes aren't recommended for complex web applications that make heavy use of CSS, but for small projects they may be a nice option.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">Where it all Falls Apart</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder (Work Around #1)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s) (Work Around #2)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style with Themes (Work Around #4)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/">Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Underscore (_) rendering issues with Cascading Style Sheets (CSS) in Internet Explorer (IE), Firefox, and other browsers</title>
		<link>http://adam.kahtava.com/journal/2007/01/07/underscore-_-rendering-issues-with-cascading-style-sheets-css-in-internet-explorer-ie-firefox-and-other-browsers/</link>
		<comments>http://adam.kahtava.com/journal/2007/01/07/underscore-_-rendering-issues-with-cascading-style-sheets-css-in-internet-explorer-ie-firefox-and-other-browsers/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 21:22:46 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DOM]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,3ac7da1a-d857-4cdf-b81a-e62fe30d6ddd.aspx</guid>
		<description><![CDATA[The World Wide Web Consortium (W3C) Cascading Style Sheets (CSS) 2 specifications introduced the underscore (_) as a valid CSS naming character, this allows CSS selectors like class selectors and ID selectors to be named like:

 ._menu_item_1
 #_menu_item_2
 .menu_item_3
 #menu_item_4

However; rendering inconsistencies remain among most popular browsers when Styles, Classes, or IDs are preceded by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.w3.org/">The World Wide Web Consortium (W3C)</a> <a href="http://www.w3.org/TR/REC-CSS2/">Cascading Style Sheets (CSS) 2 specifications</a> introduced the underscore (_) as a valid CSS naming character, this allows CSS selectors like <a href="http://www.w3.org/TR/REC-CSS2/selector.html#class-html">class selectors</a> and <a href="http://www.w3.org/TR/REC-CSS2/selector.html#id-selectors">ID selectors</a> to be named like:</p>
<ul>
<li> ._menu_item_1</li>
<li> #_menu_item_2</li>
<li> .menu_item_3</li>
<li> #menu_item_4</li>
</ul>
<p>However; rendering inconsistencies remain among most popular browsers when Styles, Classes, or IDs are preceded by the underscore character.</p>
<p><strong>Inconsistencies:</strong></p>
<p>CSS Classes and IDs with an underscore immediately after their respective delimiter ('.' Or '#') are rendered by both Firefox and Opera, but <strong>NOT by Internet Explorer</strong>.<br />
<strong>This CSS example will NOT work in Internet Explorer, but WILL work in Firefox and Opera:</strong></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><strong><span style="color: maroon;">._idTest1</span>{</strong><br />
<span> </span><span style="color: red;">background-color</span>: <span style="color: blue;">red</span>;<br />
<span> </span>}<br />
<span> </span><strong><span style="color: maroon;">#_id_Test2</span>{</strong><br />
<span> </span><span style="color: red;">background-color</span>: <span style="color: blue;">red</span>;</span></p>
<p class="MsoNormal">Style entries preceded by an underscore are rendered by Internet Explorer (IE 6 &amp; 7), but <strong>NOT by Mozilla / Gecko (Firefox) or Opera</strong>.</p>
<p><strong>This CSS example will only work in Internet Explorer:</strong></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: maroon;">*</span>{<br />
<span> </span><span style="color: red; font-weight: bold;">_color</span>: <span style="color: blue; font-weight: bold;">green</span>;<span><br />
</span>}</span></p>
<p>This is a documented quirk and bug, see <a href="http://wellstyled.com/css-underscore-hack.html">The Underscore Hack</a> and <a href="http://www.easy-designs.net/articles/ieUnderscoreBug/">IE Underscore Bug Test</a> for more information.</p>
<p><strong>The Results of our Underscored CSS in Internet Explorer:</strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/UnderscoreTest1_IE.png" alt="" /></p>
<p><strong>The Results of our Underscored CSS in FireFox (rendered the same in Opera):</strong><strong></strong><br />
<img src="http://adam.kahtava.com/journal/images/blog/UnderscoreTest1_FF.png" alt="" /></p>
<p>This CSS quirk came up in an <a href="http://en.wikipedia.org/wiki/ASP.NET">ASP.NET</a> forum, where a poster was having cross browser issues with his menu controls. We discovered that <span><span style="font-family: arial; font-size: x-small;"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">xhtmlConformance</span><span style="color: #ff0000;"> mode</span><span style="color: #0000ff;">="Legacy"</span><span style="color: #ff0000;"> </span><span style="color: #0000ff;">/&gt;</span></span></span> was defined in his web.config file which caused the ASP.NET Master Page control (ctl00) to be preceded by an underscore (_ctl00) which was preventing the CSS from being rendered in IE.</p>
<p><strong>Related links:</strong><br />
The <a href="http://www.easy-designs.net/articles/ieUnderscoreBug/">IE Underscore Bug Test</a><br />
The original forum thread: <a href="http://forums.asp.net/thread/1504767.aspx">menu control in master page does not get styles in ie 6.0</a>.<br />
ScottGu's Blog: <a href="http://weblogs.asp.net/scottgu/archive/2006/12/10/gotcha-don-t-use-xhtmlconformance-mode-legacy-with-asp-net-ajax.aspx">Gotcha: Don't use &lt;xhtmlConformance mode="Legacy"/&gt; with ASP.NET AJAX</a><br />
View the complete source code for my Underscore Test or try it on your favorite browser <a href="http://adamdotcom-script.googlecode.com/svn/trunk/Etcetera/the-css-underscore-test.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2007/01/07/underscore-_-rendering-issues-with-cascading-style-sheets-css-in-internet-explorer-ie-firefox-and-other-browsers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Problems with Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 - Defining a Media Type(s) (Work Around #2)</title>
		<link>http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/</link>
		<comments>http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/#comments</comments>
		<pubDate>Sat, 11 Nov 2006 16:34:50 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,63d6c2f3-4cd9-4a7d-ab5a-2796033cb3a1.aspx</guid>
		<description><![CDATA[ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on <a href="http://en.wikipedia.org/wiki/Css">Cascading Stye Sheet (CSS)</a>, but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your application is even developed, instead I suggest sticking with CSS and perhaps using some default Skins that define CSS classes or IDs.</p>
<p><strong>The Problem / Question:</strong><br />
Is it possible to define CSS Media types (like <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">media</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">="print"</span>) in the HTML Head tag? ASP.NET 2.0 automatically includes all my CSS files (from the active Theme directory) into the <a href="http://en.wikipedia.org/wiki/HTML">HTML</a> Head tag, but Themes don't allow me to specify any <a href="http://www.w3.org/TR/REC-CSS2/media.html">CSS Media types</a>.</p>
<p><strong>The Solutions / Work Arounds:</strong><br />
Sub class the <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlhead_members.aspx">HtmlHead class</a> to enumerate through the child controls and add new Meta attributes to the child controls using the <a href="http://msdn2.microsoft.com/en-US/library/system.web.ui.htmlcontrols.htmllink_properties.aspx">HtmlLink class</a>. In order to use multiple Media types you would probably need to use more complex logic and resolve Media types to filenames (i.e. SomeFileName_Print.css could resolve to <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">media</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">="print"</span>) - for more information on manipulating the HtmlHead class read <a href="http://weblogs.asp.net/pscott/default.aspx">Phil Scott's</a> post titled: <a href="http://weblogs.asp.net/pscott/archive/2005/08/30/424039.aspx">Accessing the Html Header in ASP.NET 2.0</a>.</p>
<p><strong>An example of the problem:</strong><br />
The HTML source automatically generated by ASP.NET 2.0 Themes (note the lack of <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">media</span> attributes):<br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;"> &lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0 <span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/HandHeld.css"</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Print.css"</span><br />
<span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Screen.css"</span><br />
<span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></p>
<p>My desired HTML source (note the <strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">media</span></strong> attributes in bold):<br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;"> &lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0 <span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Default.css"</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <strong><span style="color: red;">media</span><span style="color: blue;">=</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong><span style="color: blue;">all</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong></strong> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/HandHeld.css"</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <strong><span style="color: red;">media</span><span style="color: blue;">=</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong><span style="color: blue;">handheld</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong></strong> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Print.css"</span> </span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: red;"> type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <strong><span style="color: red;">media</span><span style="color: blue;">=</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong><span style="color: blue;">print</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong></strong> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;"> &lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Screen.css"</span> </span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: red;"> type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <strong><span style="color: red;">media</span><span style="color: blue;">=</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong><span style="color: blue;">screen</span></strong></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: blue;">"</span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><strong></strong> <span style="color: blue;">/&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></p>
<p>The Pros and Cons of this approach:<br />
<strong></strong></p>
<p><strong>Cons:</strong></p>
<ol>
<li> Can't use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Microsoft's Conditional Comments</a></li>
<li> Can't use the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">CSS @Import rule</a></li>
<li> Can't use the <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">CSS @Media rule</a></li>
<li> Can't easily use multiple <a href="http://www.w3.org/TR/REC-CSS2/media.html">CSS Media types</a></li>
<li> Can't easily control <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.3.1">CSS preferred and alternate style sheets</a></li>
<li> Can't easily control the CSS load order (<a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.2">inheritance and cascading</a>)</li>
<li> Contributes to a fragile environment</li>
<li> Not intuitive _ a maintenance programmers nightmare - "I know CSS, but Where are the Media types defined and How are they controlled?"</li>
</ol>
<p><strong>Pros:</strong></p>
<ol>
<li> Can define a single <a href="http://www.w3.org/TR/REC-CSS2/media.html">Media type</a> for all .css files relatively easy</li>
<li> Could define multiple Media types - with more complex logic dependant on .css file naming</li>
<li> Could control CSS preferred and alternate style sheets - with more complex logic dependant on .css file naming</li>
<li> Compatible with <a href="http://en.wikipedia.org/wiki/Version_control">Revision Control Systems</a> (<a href="http://en.wikipedia.org/wiki/Concurrent_Versions_System">CVS</a>, <a href="http://en.wikipedia.org/wiki/Subversion">Subversion</a>, <a href="http://en.wikipedia.org/wiki/Visual_Source_Safe">Visual Source Safe</a>, and so on)</li>
</ol>
<p><strong>In conclusion;</strong> CSS will continue to be the industry design standard - it has been the standard for well over 10 years. CSS is far more powerful than Themes and Skins, I suggest sticking with CSS and perhaps using some default Skins that define CSS classes or IDs.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">Where it all Falls Apart</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder (Work Around #1)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/">Defining the Load Order (Cascades) for CSS (Work Around #3)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style with Themes (Work Around #4)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/">Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Problems with Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 - Excluding a CSS folder (Work Around #1)</title>
		<link>http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/</link>
		<comments>http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/#comments</comments>
		<pubDate>Fri, 10 Nov 2006 00:32:47 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,7e992478-da0f-4ce4-bb43-3a0b58f6f3ad.aspx</guid>
		<description><![CDATA[ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0's Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don't fully support CSS - I've listed some "Work Arounds" for a couple design flaws. I don't recommend any of these "Work Arounds" since they contribute to software entropy before your application is even developed, instead I suggest sticking with CSS and perhaps using some default Skins that define CSS classes or IDs.</p>
<p><strong>The Problem / Question: </strong><br />
How can I exclude a subdirectory (sub folder) containing <a href="http://en.wikipedia.org/wiki/Css">Cascading Style Sheets (CSS)</a> in a Theme (App_Theme) directory? ASP.NET 2.0 automatically includes all CSS files (.css) from the active Theme directory and sub directories into the rendered HTML page, but doesn't allow me to exclude a folder of CSS files or a single CSS file.</p>
<p><strong>The Solutions / Work Arounds:</strong></p>
<ol>
<li> Create your CSS directory outside the App_Theme directory then map a Virtual Directory inside your Theme directory.</li>
<li> Add a custom VirtualPathProvider to ignore the non-root level CSS files in sub directoriesÂ  - See <a href="http://blogs.msdn.com/davidebb/default.aspx">David Ebbo's</a> article titled: <a href="http://blogs.msdn.com/davidebb/archive/2005/11/27/overriding-asp-net-combine-behavior-using-a-virtualpathprovider.aspx">Overriding ASP.NET combine behavior using a VirtualPathProvider</a>.</li>
</ol>
<p>These "Work Arounds" are useful if you want to do something like this (note: Default.css is sitting in the root of the active Theme directory):</p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">/* Default.css */</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">@Import</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> "</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">StyleSheets/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Common.css ";</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">@Import</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> "</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">StyleSheets/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Masterpage.css";</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;"> &lt;!--[if IE]&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> "StyleSheets/FixInternetExplorer_Quirks.css";</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&lt;![endif]--&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&lt;!--[if IE 7]&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> "StyleSheets/FixInternetExplorer7Quirks.css";</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&lt;![endif]--&gt;</span></p>
<p>Or if you wanted to use an Embedded CSS Statement like this:</p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: red;">type</span><span style="color: blue;">="text/css"&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;!<span style="color: maroon;">--</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> "StyleSheets/HideNavigation.css";</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> "StyleSheets/HideSearchBars.css";</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">--<span style="color: maroon;">&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">style</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></p>
<p>The Pros and Cons of this approach:</p>
<p><strong>Cons</strong>:</p>
<ol>
<li> Can't really define <a href="http://www.w3.org/TR/REC-CSS2/media.html">CSS media types</a>, but we can now use the <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">CSS @Media rule</a></li>
<li> Can't control <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.3.1">CSS preferred and alternate style sheets</a></li>
<li> Doesn't scale well</li>
<li> Contributes to a fragile development environment</li>
<li> Not very compatible with <a href="http://en.wikipedia.org/wiki/Version_control">Revision Control Systems</a> (<a href="http://en.wikipedia.org/wiki/Concurrent_Versions_System">CVS</a>, <a href="http://en.wikipedia.org/wiki/Subversion">Subversion</a>, <a href="http://en.wikipedia.org/wiki/Visual_Source_Safe">Visual Source Safe</a>, and so on)</li>
<li> Not intuitive _ a maintenance programmer's nightmare, "I know CSS, but Where is the CSS folder?" or "I know CSS, but Why and How are some CSS folders excluded?</li>
</ol>
<p><strong>Pros</strong>:</p>
<ol>
<li> Can control the load order (<a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.2">inheritance and cascading</a>) through the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">CSS @Import rule</a></li>
<li> Can exclude a folder containing CSS files</li>
<li> Can use the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">CSS @Import rule</a></li>
<li> Can use the <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">CSS @Media rule</a></li>
<li> Can use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Microsoft's conditional comments</a></li>
</ol>
<p><strong><br />
In conclusion;</strong> CSS will continue to be the industry design standard - it has been the standard for well over 10 years. CSS is far more powerful than Themes and Skins, I suggest sticking with CSS and perhaps using some default Skins that define CSS classes or IDs.</p>
<p><strong>Related posts: </strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/">Where it all Falls Apart</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s) (Work Around #2)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/">Defining the Load Order (Cascades) for CSS (Work Around #3)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style with Themes (Work Around #4)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/">Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Where it all Falls Apart</title>
		<link>http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/</link>
		<comments>http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 01:11:28 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,4df765e2-b408-471e-9999-652cd804b683.aspx</guid>
		<description><![CDATA[Themes and Skins are a promising addition to ASP.NET 2.0, but too immature for large web projects.
The problem with Themes and Skins begins with the way Cascading Style Sheets (CSS) are automatically included into the rendered page. Through compilation logic, ASP.NET 2.0 parses through the directory and sub directories of the active Theme. ASP.NET 2.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Themes and Skins are a promising addition to ASP.NET 2.0, but too immature for large web projects.</p>
<p>The problem with Themes and Skins begins with the way <a href="http://en.wikipedia.org/wiki/Css">Cascading Style Sheets (CSS)</a> are automatically included into the rendered page. Through compilation logic, ASP.NET 2.0 parses through the directory and sub directories of the active Theme. ASP.NET 2.0 automatically includes an external CSS file reference into the HTML Head tag of the rendered page for every CSS file encountered.</p>
<p>Here's an example for a better understanding.</p>
<p>My directory structure:<br />
<img src="http://adam.kahtava.com/journal/Images/blog/TheProblemsWithThemesAndSkins.png" alt="" /></p>
<p>The output generated by Themes from the preceding directory structure:</p>
<pre><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt; </span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span>The Problems With Themes and Skins in ASP.NET 2.0 <span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/HandHeld.css"</span>
   <span style="color: red;">type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Print.css" </span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Screen.css" </span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheets/FixInternetExplorer7Quirks.css"</span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheets/FixInternetExplorerQuirks.css" </span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span>/&gt; </span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheets/HideAdvertisments.css" </span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheets/HideBorders.css" </span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><span> </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/StyleSheets/HideMenus.css" </span>
<span style="color: red;">   type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="color: blue;">/&gt;</span></span>
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></pre>
<p>As you can see, the external CSS file references are automatically included in the rendered page - the load order of CSS files seems to depend on the directory and CSS file name. In this example the root directory is parsed alphabetically then the sub directory is parsed alphabetically.</p>
<p>It's neat how ASP.NET 2.0 automatically includes .css files, but this behavior severely limits the use of CSS (see the list below), and encourages developers / designers to create many .css files which introduces new problems - Internet Explorer has a 30 style sheet limitation, see article <a href="http://support.microsoft.com/kb/q262161">Q262161</a>.</p>
<p><strong>Problems:</strong></p>
<ul>
<li> As the name implies Cascading Style Sheets (CSS) depend on the order in which files are loaded (cascades), in addition to other rules like the CSS @import and CSS @Media rule. By automatically loading all .css files into the header, Themes prevent cascades and loading order from being defined.</li>
<li> The automatic inclusion of .css files prevents the use of Microsoft's Conditional Comments.</li>
<li> The automatic inclusion of CSS files omits the CSS Media type.</li>
</ul>
<p><strong>A rough list of CSS features compromised by Themes in ASP.NET 2.0:</strong></p>
<ol>
<li> <a href="http://www.w3.org/TR/REC-CSS2/media.html">CSS media types</a></li>
<li> <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">The CSS @Import rule</a></li>
<li> <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">The CSS @Media rule</a></li>
<li> <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.3.1">Preferred and alternate style sheets</a></li>
<li> <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.1">Media-dependent cascades</a></li>
<li> <a href="http://www.w3.org/TR/html4/present/styles.html#h-14.4.2">Inheritance and cascading</a></li>
<li> <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">The use of Microsoft's Conditional Comments</a></li>
</ol>
<p>An example of when these compromised features are useful:</p>
<pre><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-family: 'Courier New'; color: #0000ff; font-size: x-small;">&gt;</span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span>  </span><span style="color: blue;">&lt;</span><span style="color: maroon;">title</span><span style="color: blue;">&gt;</span><span style="color: #0000ff;">The Problems With Themes and Skins in ASP.NET 2.0 </span><span style="color: blue;">&lt;/</span><span style="color: maroon;">title</span><span>&gt;</span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span>  </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/HandHeld.css" </span>
<span style="color: red;">    type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="font-size: x-small;"><strong><span style="color: red;">media</span><span style="color: blue;">="handheld"</span></strong></span> <span>/&gt;</span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span>  </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Print.css" </span>
<span style="color: red;">    type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="font-size: x-small;"><strong><span style="color: red;">media</span><span style="color: blue;">="print"</span></strong></span> <span>/&gt;</span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span>  </span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: blue;">="App_Themes/Default/Screen.css" </span>
<span style="color: red;">    type</span><span style="color: blue;">="text/css"</span> <span style="color: red;">rel</span><span style="color: blue;">="stylesheet"</span> <span style="font-size: x-small;"><strong><span style="color: red;">media</span><span style="color: blue;">="screen"</span></strong></span> <span>/&gt;</span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span><span style="color: #008000;">  </span></span><span style="font-size: x-small;"><strong><span style="color: #008000;"><span>&lt;!--[IF IE]&gt;</span></span></strong></span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: #008000;"><span>    </span>&lt;link href="App_Themes/Default/StyleSheets/FixInternetExplorerQuirks.css" </span></span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;">
<span style="color: #008000;">      type="text/css" rel="stylesheet" <span style="font-size: x-small;"><strong>media="all"</strong></span> /&gt;</span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: #008000;"><span>  </span><span style="font-size: x-small;"><strong>&lt;![endif]--&gt;</strong></span></span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: #008000;"><span>  </span><span style="font-size: x-small;"><strong><span>&lt;!--[IF IE 7]&gt;</span></strong></span></span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: #008000;"><span>    </span>&lt;link href="App_Themes/Default/StyleSheets/FixInternetExplorer7Quirks.css" </span></span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;">
<span style="color: #008000;">      type="text/css" rel="stylesheet" <span style="font-size: x-small;"><strong>media="all"</strong></span> /&gt;</span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><span style="color: #008000;"><span>  </span><span style="font-size: x-small;"><strong>&lt;![endif]--&gt;</strong></span></span></span>
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;/</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: maroon;">head</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></pre>
<p>The contents of Print.css or HandHeld.css would generally look something like this:<br />
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: green;">/* Contents of Print.css or HandHeld.css*/ </span></p>
<p><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="font-size: x-small;"><strong>@Import</strong></span></span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: #000000;">"App_Themes/Default/StyleSheets/HideAdvertisments.css";</span></span><br />
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><strong><span style="font-size: x-small;">@Import</span></strong></span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"> <span style="color: #000000;">"App_Themes/Default/StyleSheets/HideBorders.css";</span></span><br />
<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: blue;"><strong><span style="font-size: x-small;">@Import</span></strong></span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;;"> "App_Themes/Default/StyleSheets/HideMenus.css";</span></p>
<p><strong>In conclusion</strong>; Themes have a number of design flaws which limit a significant portion of CSS's mature feature set. Themes are OK for small web applications, but not recommended for large / complex applications. While there are "work arounds" for some of the issues on my list, implementing each "work around" contributes to software entropy before your application is even developed. Since Skins and Themes are really based around CSS you might be better off sticking with CSS and a single default ASP.NET 2.0 Skin in which you define some default CSS classes or ID elements for some basic ASP.NET server controls.</p>
<p><strong>Related notes:</strong></p>
<p><strong></strong><strong>Rick Strahl came to a similar conclusion:</strong></p>
<blockquote><p>theming is nice but really most of that can be accomplished with CSS and what Themes offers beyond that is really not that critical. [...] As it stands I don't really see how I can utilize Themes in my apps in a meaningful way. - <a href="http://west-wind.com/WebLog/posts/4803.aspx">Playing around with ASP.NET Themes</a></p></blockquote>
<p><strong><span>Scott Allen makes a great point:</span></strong></p>
<blockquote><p>Web designers will be more comfortable with css files. If you put the design of your site into the hands of professionals than you should be asking them to use css wherever possible. - <a href="http://www.odetocode.com/Articles/423.aspx">Themes In ASP.NET 2.0</a></p></blockquote>
<p><strong>Richard P </strong><strong>makes a related comment:</strong></p>
<blockquote><p>there are so many flaws in Themes and how they use CSS I dont know where to begin! [...] The concept of CSS and the web skin has been around for some years, and we have been building great solutions despite Visual Studio and ASP.NET. - <a href="http://discuss.joelonsoftware.com/default.asp?dotnet.12.451397.4">Themes and Skins Flawed in ASP.NET 2.0</a></p></blockquote>
<p>Learn more about Themes and Skins here: <a href="http://msdn.microsoft.com/msdnmag/issues/05/11/CuttingEdge/default.aspx">A Quick Tour of Themes in ASP.NET 2.0</a>.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li> <a href="http://adam.kahtava.com/journal/2006/11/09/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-excluding-a-css-folder-work-around-1/">Excluding a CSS folder (Work Around #1)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2006/11/11/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-a-media-types-work-around-2/">Defining a Media Type(s) (Work Around #2)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/03/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-defining-the-load-order-cascades-for-css-work-around-3/">Defining the Load Order (Cascades) for CSS (Work Around #3)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/05/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-using-internal-embedded-style-sheets-with-themes-work-around-4/">Using Internal (Embedded) Style with Themes (Work Around #4)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/02/25/the-problems-with-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-creating-printer-friendly-pages-defining-a-css-print-media-type-with-css-while-using-themes-work-around-5/">Creating Printer Friendly Pages (defining a CSS Print Media Type) with CSS While Using Themes (Work Around #5)</a></li>
<li> <a href="http://adam.kahtava.com/journal/2007/04/02/a-resolution-to-the-problems-with-themes-skins-and-cascading-style-sheets-css-putting-the-cascades-back-into-aspnet-20-themes-taking-control-over-css-cascades-load-order-media-types-and-o/">A Resolution to The Problems with Themes, Skins, and Cascading Style Sheets (CSS) - Putting the Cascades back into ASP.NET 2.0 Themes (taking control over CSS Cascades / Load Order, Media Types, and Overrides)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/11/08/the-problems-with-themes-skins-and-cascading-style-sheets-css-where-it-all-falls-apart/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Reflection on Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 (Part 2)</title>
		<link>http://adam.kahtava.com/journal/2006/10/30/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-part-2/</link>
		<comments>http://adam.kahtava.com/journal/2006/10/30/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-part-2/#comments</comments>
		<pubDate>Tue, 31 Oct 2006 00:26:43 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,69f6fc25-9820-4abf-a930-b119401b1dc7.aspx</guid>
		<description><![CDATA[Themes and Skins depend on Cascading Style Sheets (CSS) and HTML / XHTML, but Themes and Skins don't fully support CSS - now that's a paradox.

HTML, XHTML, XML, and other related Markup Languages can all be manipulated through CSS - ASP.NET generates most of these languages. If your not yet familair with ASP.NET 2.0 Themes [...]]]></description>
			<content:encoded><![CDATA[<p>Themes and Skins depend on <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">Cascading Style Sheets (CSS)</a> and <a href="http://en.wikipedia.org/wiki/Html">HTML</a> / <a href="http://en.wikipedia.org/wiki/Xhtml">XHTML</a>, but Themes and Skins don't fully support CSS - now that's a paradox.</p>
<div><img class="aligncenter" src="http://adam.kahtava.com/journal/images/blog/ASP.NET.Skins.Themes.CSSa.png" alt="" width="361" height="200" /></div>
<p>HTML, XHTML, <a href="http://en.wikipedia.org/wiki/Xml">XML</a>, and other related Markup Languages can all be manipulated through CSS - ASP.NET generates most of these languages. If your not yet familair with ASP.NET 2.0 Themes and Skins: <strong>Skins</strong> give developers and designers a little more precision to manipulate server side controls like <a href="http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/datagrid/VB/datagrid5.aspx">datagrids</a>, and <a href="http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/Calendar/VB/Calendar4.aspx">calendars</a>, but Skins fundamentally depend on CSS. <strong>Themes</strong> allow us to group our Skins, CSS files, graphics / images, and so on into logical groups or directories, but Themes really depend on CSS through Skins and CSS (.css) file references.</p>
<p><strong>Both ASP.NET Themes and Skins are directly dependent on Cascading Style Sheets (CSS)</strong>. However; Themes and Skins prohibit a good deal of CSS's functionality - I'll discuss this is my next post. CSS has been with us for over a decade, it's a pretty powerful display mechanism for web applications. CSS can manipulate HTML, XHTML, XML, SVG, XUL and other common Markup Languages.</p>
<p>I've come up with a number Theme and Skin related questions <span style="text-decoration: line-through;">that I have yet to answer</span>.</p>
<p><strong>Questions</strong>:</p>
<p><strong>If Themes and Skins rely on CSS why not just use CSS?</strong><br />
<strong>Answer:</strong> Default Skins are good, they provide hooks (class and ID selectors) for defining CSS. Themes are OK they let us logically group images and design related files, but fall short in a number of areas and are not recommended for large web applications.Â </p>
<p><strong>If it's possible to accomplish all that Skins and Themes offers through CSS why should I make the switch?</strong><br />
<strong>Answer:</strong> Skins can make life easier for your web designers, when used to hook into CSS classes and ID selectors.</p>
<p><strong>CSS is a mature, robust language, it's been around for over 10 years so more designers / developers are familiar with it, why should I switch to a a technology that is unfamiliar to most of the people that will be maintaining the application?</strong><br />
<strong>Answer:</strong> It's not a clear case of CSS vs Themes since you really can't have Themes without CSS. If used properly Themes can augment CSS.</p>
<p><strong>Are Themes and Skins really scalable for a large enterprise level web application?</strong><br />
<strong>Answer:</strong> Not really, having a seperate server or <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network">Content Delivery Network</a> for site resources like images, stylesheets, etc... is probably the best approach. Themes and Skins do prove uesful for small web applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/10/30/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Reflection on Themes, Skins, and Cascading Style Sheets (CSS) in ASP.NET 2.0 (Part 1)</title>
		<link>http://adam.kahtava.com/journal/2006/10/29/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-part-1/</link>
		<comments>http://adam.kahtava.com/journal/2006/10/29/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-part-1/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 16:06:18 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[Themes and Skins]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,7febbbfc-c506-45ad-817d-af62ed1645be.aspx</guid>
		<description><![CDATA[While Themes and Skins are new to ASP.NET 2.0, the underlying concepts have been around for a long time. For those unfamiliar with Themes and Skins, skins give web designers greater flexibility to manipulating ASP.NET server side controls (calendars, datagrids, etc...) through Styles / Cascading Style Sheets (CSS). Themes logically group the design tier of [...]]]></description>
			<content:encoded><![CDATA[<p>While Themes and Skins are new to ASP.NET 2.0, the underlying concepts have been around for a long time. For those unfamiliar with Themes and Skins, skins give web designers greater flexibility to manipulating ASP.NET server side controls (calendars, datagrids, etc...) through Styles / Cascading Style Sheets (CSS). Themes logically group the design tier of an application into a common folder or directory (a Theme folder(s)), giving developers the ability to programmatically change (swap), or expose these Themes to the user.</p>
<p>Learn more: <a href="http://msdn2.microsoft.com/en-us/library/ykzx33wh.aspx">ASP.NET Themes and Skins Overview</a>.<br />
See a live example here: <a href="http://www.dotnettreats.com/SampleThemes/Default.aspx">ASP.NET 2.0 Colorful Web Site Starter Kit</a>.</p>
<p>The concept of interchanging layout and changing design styles (Themes) has been around for quite some time. The <a href="http://www.w3.org/TR/html401/present/">W3C Recommendation for Style Sheets in HTML documents</a> outlines the "<a href="http://www.w3.org/TR/html401/present/styles.html#h-14.3.1">alternate stylesheet</a>" that should be interchanged through the browsers menu; unfortunately Internet Explorer (IE) fails to support this method.</p>
<p>An example: changing style sheets with a Mozilla based browser (<a href="http://www.mozilla.com/en-US/firefox/">Firefox</a>).</p>
<div><img src="http://adam.kahtava.com/journal/images/blog/damowmow.com.bubbles.png" alt="" /><br />
<img src="http://adam.kahtava.com/journal/images/blog/damowmow.com.modern.png" alt="" /></div>
<p>See the live example (if you're not using IE) at: <a href="http://www.damowmow.com/indexes/multiple.html">www.damowmow.com</a>.</p>
<p>Other methods for changing design layouts (Themes) range from Client Side Scripts (JavaScript) to Server Side Scripts (ASP, PHP, ASP.NET, and so on).</p>
<p>Learn more about style interchanging scripts and more here: <a href="http://css-discuss.incutio.com/?page=StyleSwitching">Style Switching - css-discuss</a>.</p>
<p>Themes and Skins are a welcome addition to ASP.NET 2.0, they offer a simple solution for grouping design specific files, and a nice way to programmatically change these Themes. However; this simplistic approach significantly hampers the power of Cascading Style Sheets _ I'll discuss my difficulties / problems in subsequent posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/10/29/a-reflection-on-themes-skins-and-cascading-style-sheets-css-in-aspnet-20-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A reflection on Cascading Style Sheets (CSS)</title>
		<link>http://adam.kahtava.com/journal/2006/10/12/a-reflection-on-cascading-style-sheets-css/</link>
		<comments>http://adam.kahtava.com/journal/2006/10/12/a-reflection-on-cascading-style-sheets-css/#comments</comments>
		<pubDate>Fri, 13 Oct 2006 00:18:36 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,9343a7f1-47ff-47f3-8db7-c69740506be6.aspx</guid>
		<description><![CDATA[I've been using Cascading Style Sheets (CSS)Â since the mid 90's. The lack of consistent support across browsers had always impeded my shift from table based design to CSS design. When I did make the transition, I can clearly recall the frustration, and confusion that preceded. Lately I've been using Themes and Master Pages (ASP.NET 2.0) [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">Cascading Style Sheets (CSS)</a>Â since the mid 90's. The lack of consistent support across browsers had always impeded my shift from table based design to CSS design. When I did make the transition, I can clearly recall the frustration, and confusion that preceded. Lately I've been using Themes and Master Pages (ASP.NET 2.0) with CSS. Personally I don't like how .NET automagically inserts the CSS file references into the header. Much of CSS's power is determined by the loading order, and the ability to define separate CSS files for <a href="http://en.wikipedia.org/wiki/Internet_Explorer">Internet Explorer (IE)</a>.</p>
<p><strong>I've compiled a list of techniques I find useful when developing CSS:</strong></p>
<p>When designing my CSS I try to use a browser that is W3C compliant (<a href="http://en.wikipedia.org/wiki/Firefox">Firefox</a>, <a href="http://en.wikipedia.org/wiki/Opera_web_browser">Opera</a>), I then apply fixes for the many quirks found in IE.<br />
I find it easier to develop CSS in a text editor, rather than a <a href="http://en.wikipedia.org/wiki/Wysiwyg">WYSIWIG</a> editor - perhaps I'm a bit of a standards geek, but I like to thoroughly understand a technology rather than rely on wizards, etc...</p>
<p>By inserting the code below into a webpage's header you define a CSS file that will only be loaded by IE, this is great for fixing display issues in IE by overloading the effected CSS elements.<br />
<span style="font-family: 'Courier New'; color: #006400; font-size: x-small;">&lt;!--[if IE]&gt;</span><br />
<span style="font-family: 'Courier New'; color: #006400; font-size: x-small;">Â Â Â Â Â Â  &lt;link href="IEQuirkFixFile.css" rel="stylesheet"<br />
Â Â Â  Â Â Â  Â Â Â  type="text/css" media="all" /&gt;</span><br />
<span style="font-family: 'Courier New'; color: #006400; font-size: x-small;">&lt;![endif]--&gt;</span></p>
<p>You can also define different CSS files for different media types like a printer, letting us hide content (like navigation menus) that you don't want printed.<br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #0000ff;">&lt;</span><span style="color: #a52a2a;">link</span> <span style="color: #ff0000;">href=</span><span style="color: #0000ff;">"HideAllNavigationalContent.css"</span> <span style="color: #ff0000;">rel=</span><span style="color: #0000ff;">"stylesheet"</span> <span style="color: #ff0000;">type=</span><span style="color: #0000ff;">"text/css"</span> <span style="color: #ff0000;">media=</span><span style="color: #0000ff;">"print"</span> <span style="color: #0000ff;">/&gt;</span> </span></p>
<p>You can specify other media types like: Braille, handheld, projection, tv, and so on. See more media types here: <a href="http://www.w3.org/TR/REC-CSS2/media.html#media-types">http://www.w3.org/TR/REC-CSS2/media.html#media-types</a></p>
<p>CSS can be applied in 3 different ways: Inline, Embedded, and External (Linked or Imported). It's nice to keep everything in external files as this method promotes a more n-tier approach even in the presentation level, but I also find it convenient to override classes through CSS Embedded blocks.</p>
<p><strong>An example:</strong><br />
The following Embedded CSS will hide a Navigation menu, and increase the Content pane to 100% when inserted into webpage. Using a combination of Embedded and External CSS can allow us to use a single Master Page.</p>
<p><span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #0000ff;">&lt;</span><span style="color: #a52a2a;">style</span> <span style="color: #ff0000;">type=</span><span style="color: #0000ff;">"text/css"</span><span style="color: #0000ff;">&gt;</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">&lt;!-- </span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â  #Navigation</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â  {</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â Â Â Â Â  display: none;</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â  }</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â  #MainContent</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â  {</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â Â Â Â  max-width: 100%;</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â Â Â Â  width: 100%;</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">Â Â Â  }</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">--&gt;</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #0000ff;">&lt;/</span> <span style="color: #a52a2a;">style</span><span style="color: #0000ff;">&gt;</span></span></p>
<p>CSS coupled with <a href="http://en.wikipedia.org/wiki/Svg">SVG (Scalable Vector Graphics)</a> and <a href="http://en.wikipedia.org/wiki/Xml">Extensible Markup Language (XML)</a> is becoming an increasingly powerful technology, and most web applications under the <a href="http://en.wikipedia.org/wiki/Web_2.0">Web 2.0</a> (alternatively known as <a href="http://www.readwriteweb.com/archives/cease_and_desis.php">Chmod 777 web</a> or the <a href="http://www.readwriteweb.com/archives/cease_and_desis.php">Read / Write Web</a>) use CSS, <a href="http://en.wikipedia.org/wiki/Xhtml">XHTML</a>, <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">AJAX</a>, Clean and meaningful URLs (URL Rewriting), and so on.</p>
<p>View a SVG example: <a href="http://www.w3schools.com/svg/svg_examples.asp">http://www.w3schools.com/svg/svg_examples.asp</a></p>
<p><strong>Related links:</strong><br />
<a href="http://www.w3.org/Style/CSS/">Cascading Style Sheets Home Page</a><br />
<a href="http://www.csszengarden.com/">CSS Zen Garden</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/10/12/a-reflection-on-cascading-style-sheets-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Resolving Parser Errors: Unknown server tag &#8216;atlas:ScriptManager&#8217; in ATLAS (AJAX)</title>
		<link>http://adam.kahtava.com/journal/2006/09/17/resolving-parser-errors-unknown-server-tag-atlasscriptmanager-in-atlas-ajax/</link>
		<comments>http://adam.kahtava.com/journal/2006/09/17/resolving-parser-errors-unknown-server-tag-atlasscriptmanager-in-atlas-ajax/#comments</comments>
		<pubDate>Sun, 17 Sep 2006 14:13:44 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[ASP.NET AJAX]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,b74145d5-8787-424a-b3ed-873e8fedadfc.aspx</guid>
		<description><![CDATA[I encountered a number of Parse Error Messages while implementing the Accordion control from ATLAS.
The error messages read:
Parser Error Message: Unknown server tag 'atlas:ScriptManager'.Â 
 Source Error:Â  &#60;atlas:ScriptManager id="ScriptManager" runat="server" /&#62;
This message occured for a number of different reasons, this brief checklist should resolve your parse errors.
1) Ensure that the following assemblies are in your bin [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered a number of Parse Error Messages while implementing the <a href="http://atlas.asp.net/atlastoolkit/Accordion/Accordion.aspx">Accordion control</a> from <a href="http://atlas.asp.net/">ATLAS</a>.</p>
<p>The error messages read:<br />
<strong>Parser Error Message: Unknown server tag 'atlas:ScriptManager'.Â </p>
<p></strong><strong> Source Error:Â  &lt;atlas:ScriptManager id="ScriptManager" runat="server" /&gt;</strong></p>
<p>This message occured for a number of different reasons, this brief checklist should resolve your parse errors.</p>
<p><strong>1)</strong> Ensure that the following assemblies are in your bin directory:<br />
<span style="font-family: 'Courier New'; font-size: x-small;">AtlasControlToolkit.dll<br />
Microsoft.AtlasControlExtender.dll<br />
Microsoft.Web.Atlas.dll</span></p>
<p><strong>2)</strong> Ensure that the following has been added to your web.config file</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">pages</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span>Â  </span>&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">controls</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
<span>Â Â Â  </span>&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">add</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">namespace</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">"<span style="color: blue;">Microsoft.Web.UI</span>"<span style="color: blue;"><br />
</span><span style="color: red;">Â Â Â  Â Â Â Â  assembly</span><span style="color: blue;">=</span>"<span style="color: blue;">Microsoft.Web.Atlas</span>"<span style="color: blue;"> </span><span style="color: red;">tagPrefix</span><span style="color: blue;">=</span>"<span style="color: blue;">atlas</span>"<span>/&gt;<br />
Â Â Â  </span>&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">add</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">namespace</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">"<span style="color: blue;">Microsoft.Web.UI.Controls</span>"<span style="color: blue;"><br />
</span><span style="color: red;">Â Â Â  Â Â Â Â  assembly</span><span style="color: blue;">=</span>"<span style="color: blue;">Microsoft.Web.Atlas</span>"<span style="color: blue;"> </span><span style="color: red;">tagPrefix</span><span style="color: blue;">=</span>"<span style="color: blue;">atlas</span>"<span>/&gt;<br />
Â Â Â  </span>&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">add</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">namespace</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">"<span style="color: blue;">AtlasControlToolkit</span>"<span style="color: blue;"><br />
</span><span style="color: red;">Â Â Â  Â Â Â Â  assembly</span><span style="color: blue;">=</span>"<span style="color: blue;">AtlasControlToolkit</span>"<span style="color: blue;"> </span><span style="color: red;">tagPrefix</span><span style="color: blue;">=</span>"<span style="color: blue;">atlasToolkit</span>"<span>/&gt;<br />
Â  </span>&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">controls</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">pages</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></p>
<p>Related links:<br />
<a href="http://forums.asp.net/1/1347547/ShowThread.aspx">Data Binding in an AccordionPane in a Repeater</a><br />
<a href="http://forums.asp.net/thread/1324645.aspx">Atlas Control Toolkit: Unknown Server Tag</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/09/17/resolving-parser-errors-unknown-server-tag-atlasscriptmanager-in-atlas-ajax/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A great source for AJAX Frameworks and Tutorials: www.ajaxprojects.com</title>
		<link>http://adam.kahtava.com/journal/2006/07/18/a-great-source-for-ajax-frameworks-and-tutorials-wwwajaxprojectscom/</link>
		<comments>http://adam.kahtava.com/journal/2006/07/18/a-great-source-for-ajax-frameworks-and-tutorials-wwwajaxprojectscom/#comments</comments>
		<pubDate>Tue, 18 Jul 2006 23:40:06 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,fe8fbe93-2958-4054-b691-7bcfb49e3822.aspx</guid>
		<description><![CDATA[I came across a great AJAX portal site this morning. This site covers a variety (PHP, JAVA, .NET, Ruby, etc...) of AJAX Frameworks and Tutorials.Â Visit Ajax Projects: http://www.ajaxprojects.com/
Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a great <a href="http://en.wikipedia.org/wiki/AJAX">AJAX</a> portal site this morning. This site covers a variety (PHP, JAVA, .NET, Ruby, etc...) of AJAX Frameworks and Tutorials.Â Visit Ajax Projects: <a href="http://www.ajaxprojects.com/">http://www.ajaxprojects.com/</a></p>
<blockquote><p><em>Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability.</em> - <a href="http://en.wikipedia.org/wiki/AJAX">Wikipedia: AJAX</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/07/18/a-great-source-for-ajax-frameworks-and-tutorials-wwwajaxprojectscom/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quality Assurance: Advanced Unit Testing: NUnit</title>
		<link>http://adam.kahtava.com/journal/2006/07/17/quality-assurance-advanced-unit-testing-nunit/</link>
		<comments>http://adam.kahtava.com/journal/2006/07/17/quality-assurance-advanced-unit-testing-nunit/#comments</comments>
		<pubDate>Tue, 18 Jul 2006 06:22:05 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSharp]]></category>

		<category><![CDATA[Quality Assurance]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,06a8aa8f-cae2-4110-801a-5201bce3de75.aspx</guid>
		<description><![CDATA[Marc Clifton has a great five part series on Advance Unit Testing. Throughout these articles Marc builds a Unit Testing framework based on the NUnit framework - NUnit is a Unit Testing framework for Microsoft .NET, it's very similar to the JUnit framework for Java. Marc explores Unit Testing, the interworkings of Unit Testing frameworks, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.marcclifton.com/">Marc Clifton</a> has a great five part series on Advance Unit Testing. Throughout these articles Marc builds a <a href="http://en.wikipedia.org/wiki/Unit_test">Unit Testing</a> framework based on the <a href="http://en.wikipedia.org/wiki/NUnit">NUnit</a> framework - NUnit is a Unit Testing framework for Microsoft .NET, it's very similar to the <a href="http://en.wikipedia.org/wiki/JUnit">JUnit</a> framework for Java. Marc explores Unit Testing, the interworkings of Unit Testing frameworks, and the <a href="http://en.wikipedia.org/wiki/Extreme_Programming">XP</a> methodology.<br />
Don't be intimidated by the number or size of these articles - most of the content is source code.</p>
<ul>
<li><a href="http://www.codeproject.com/csharp/autp1.asp">Part I:</a> Introduction to unit testing and a case study taking the XP process up to the point of writing some unit tests</li>
<li><a href="http://www.codeproject.com/csharp/autp2.asp">Part II</a>: Implementation of an NUnit look-alike and developing the case study further with real tests and real code</li>
<li><a href="http://www.codeproject.com/csharp/autp3.asp">Part III</a>: Implementation of NUnit extensions, revising and progressing with the case study</li>
<li><a href="http://www.codeproject.com/csharp/autp4.asp">Part IV</a>: Using reflection to create unit tests that are script based instead of code based, and the impact of that on the case study</li>
<li><a href="http://www.codeproject.com/gen/design/autp5.asp">Part V</a>: Unit Test Patterns</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/07/17/quality-assurance-advanced-unit-testing-nunit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Amazon E-Commerce Service (ECS) Web Services Description Language (WSDL) and ASP.NET</title>
		<link>http://adam.kahtava.com/journal/2006/07/03/the-amazon-e-commerce-service-ecs-web-services-description-language-wsdl-and-aspnet/</link>
		<comments>http://adam.kahtava.com/journal/2006/07/03/the-amazon-e-commerce-service-ecs-web-services-description-language-wsdl-and-aspnet/#comments</comments>
		<pubDate>Tue, 04 Jul 2006 00:53:14 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[Amazon]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,9efc873e-5092-4b85-b084-3febf9261dac.aspx</guid>
		<description><![CDATA[While developing a component for Amazon's E-Commerce Service (ECS) Web Services Description Language (WSDL) (Version 4.0), I encountered a couple minor issues and found the following links of use:
Issues:

Version 4.0 of the ECS WSDL is not compatible with Microsoft's Visual Studio (VS) 2003. However, the ECS WSDL works fine in VS 2005, a workaround for [...]]]></description>
			<content:encoded><![CDATA[<p>While developing a component for Amazon's E-Commerce Service (ECS) Web Services Description Language (WSDL) (Version 4.0), I encountered a couple minor issues and found the following links of use:</p>
<p><strong>Issues:<br />
</strong></p>
<blockquote><p>Version 4.0 of the ECS WSDL is not compatible with Microsoft's Visual Studio (VS) 2003. However, the ECS WSDL works fine in VS 2005, a workaround for VS 2003 and other known issues can be found on the <a href="http://forums.prospero.com/n/mb/message.asp?webtag=am-assocdevxml&amp;msg=6911.1&amp;ctx=0">Amazon.com Associates: XML Developers Discussion Board</a>.</p></blockquote>
<p><strong>Useful links:<br />
</strong></p>
<ul>
<li>Philip Miseldine's tutorial titled: <a href="http://www.sitepoint.com/article/amazon-web-services-asp-net">Use Amazon Web Services in ASP.NET</a></li>
<li><a href="http://docs.amazonwebservices.com/AWSEcommerceService/2006-03-08/">The Amazon E-Commerce Service (ECS) Software Development Kit (SDK)</a></li>
<li><a href="http://forums.prospero.com/n/mb/listsf.asp?webtag=am-assocdevxml&amp;ctx=262144">Known Issues: Amazon.com Associates: XML Developers</a></li>
</ul>
<p>This website pulls my <a href="http://adam.kahtava.com/book-reviews/">reviews</a>, and my <a href="http://adam.kahtava.com/reading-lists/recommended-and-wishlist/">recommended reading list</a> off of Amazon.<br />
The originating Amazon data can be viewed here: my Amazon <a href="http://www.amazon.com/gp/cdp/member-reviews/A2JM0EQJELFL69/102-6923547-8216908">reviews</a>, my Amazon <a href="http://www.amazon.com/gp/registry/registry.html/?ie=UTF8&amp;type=wishlist&amp;id=3JU6ASKNUS7B8">wish list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/07/03/the-amazon-e-commerce-service-ecs-web-services-description-language-wsdl-and-aspnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Distilled: Fixing the Global.asax in ASP.NET 2.0</title>
		<link>http://adam.kahtava.com/journal/2006/06/20/distilled-fixing-the-globalasax-in-aspnet-20/</link>
		<comments>http://adam.kahtava.com/journal/2006/06/20/distilled-fixing-the-globalasax-in-aspnet-20/#comments</comments>
		<pubDate>Wed, 21 Jun 2006 06:43:08 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[CSharp]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,85996722-1d63-4cc8-8616-7f3daa952792.aspx</guid>
		<description><![CDATA[Visual Studio 2005 no longer adds a code behind file to the Global.asax file.
To add a code behind file for the Global.asax file (in C#) follow these steps:

 Open your project in Visual Studio 2005
 Add New Item from the context menu (right clicking on your project)
 Select the Global Application Class
 Make sure your [...]]]></description>
			<content:encoded><![CDATA[<p>Visual Studio 2005 no longer adds a code behind file to the Global.asax file.</p>
<p>To add a code behind file for the Global.asax file (in C#) follow these steps:</p>
<ol>
<li> Open your project in Visual Studio 2005</li>
<li> <em>Add New Item</em> from the context menu (right clicking on your project)</li>
<li> Select the <em>Global Application Class</em></li>
<li> Make sure your Global Application Class file (the .asax file) is opened</li>
<li> Delete all the contents of this .asax file</li>
<li> Add the following to this .asax file:Â  &lt;%@ Application Language="C#" Inherits="Global" %&gt;</li>
<li> Create a new class named <em>Global</em> in the <em><strong>App_Code</strong></em> directory</li>
<li> Copy the following source into your new Global class:
<pre><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;">/// Summary description for Global</span>Â </span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">public</span> <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">class</span> Global : System.Web.HttpApplication {</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> Global() { }</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">void</span> Application_Start(<span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">object</span> sender, EventArgs e) {</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">  <span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;">// Code that runs on application startup</span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> }</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">void</span> Application_End(<span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">object</span> sender, EventArgs e) {</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">  <span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;">// Code that runs on application shutdown</span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> }</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">void</span> Application_Error(<span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">object</span> sender, EventArgs e) {</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">  <span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;">// Code that runs when an unhandled error occurs</span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> }</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">void</span> Session_Start(<span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">object</span> sender, EventArgs e) {</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">  <span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;">// Code that runs when a new session is started</span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> }</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">void</span> Session_End(<span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">object</span> sender, EventArgs e) { }</span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> }</span></pre>
</li>
<li> Save, you are done</li>
</ol>
<p>The preceding has been distilled from <a href="http://rossnelson.blogspot.com/">Ross Nelson's</a> article: <a href="http://rossnelson.blogspot.com/2005/11/fixing-globalasax-in-aspnet-20.html">Fixing the Global.asax in ASP.NET 2.0</a>.</p>
<p>On a related thread: Consider using HttpModules instead of the Global.asax file, Learn more in <a href="http://codebetter.com/blogs/karlseguin/">Karl Seguin's</a> article titled: <a href="http://codebetter.com/blogs/karlseguin/archive/2006/06/12/146356.aspx">Global.asax? Use HttpModules Instead!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/06/20/distilled-fixing-the-globalasax-in-aspnet-20/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The ASP.NET 2.0 Global Application Class, Access Routines and the Global.asax file.</title>
		<link>http://adam.kahtava.com/journal/2006/05/30/the-aspnet-20-global-application-class-access-routines-and-the-globalasax-file/</link>
		<comments>http://adam.kahtava.com/journal/2006/05/30/the-aspnet-20-global-application-class-access-routines-and-the-globalasax-file/#comments</comments>
		<pubDate>Wed, 31 May 2006 06:52:27 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,b822b32c-c76b-4bc4-9f77-bfa73d045a74.aspx</guid>
		<description><![CDATA[The Global Application Class has changed in ASP.NET 2.0. When adding a Global Application Class to a project, Visual Studio no longer generates a code-behind file.

 The result as Ross Nelson points out is two fold: there is no class in the Global.asax, and without the class there is no "easy" way to reference Global [...]]]></description>
			<content:encoded><![CDATA[<p>The Global Application Class has changed in ASP.NET 2.0. When adding a Global Application Class to a project, Visual Studio no longer generates a code-behind file.
<div class="itemBody">
<p> The result as <a href="http://rossnelson.blogspot.com">Ross Nelson</a> points out is two fold: there is no class in the Global.asax, and without the class there is no "easy" way to reference Global routines / objects. </p>
<p> I&#39;ve long been a fan of wrapping application globals into Access Routines, creating one static instance of the class, then accessing these routines through the Global class. </p>
<p> Ross has an excellent solution to this problem: <a href="http://rossnelson.blogspot.com/2005/11/fixing-globalasax-in-aspnet-20.html">(Fixing the Global.asax in ASP.NET 2.0)</a>.</p></div>
<p> For a summarized (distilled) version of Ross&#39;s article view: <a href="http://adam.kahtava.com/journal/2006/06/20/distilled-fixing-the-globalasax-in-aspnet-20/">Distilled: Fixing the Global.asax in ASP.NET 2.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/05/30/the-aspnet-20-global-application-class-access-routines-and-the-globalasax-file/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
