<?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; ASP.NET</title>
	<atom:link href="http://adam.kahtava.com/journal/category/aspnet/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>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&#8217;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&#8217;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&#8217;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&#8217;mÂ runningÂ this site on Windows shared hosting whichÂ unfortunatelyÂ doesn&#8217;t give me many options - sure, sure, I could purchase another hosting account, but developers are like freak&#8217;nÂ MAcGyverÂ we like working withinÂ ridiculousÂ constraints. It&#8217;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&#8217;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>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&#8217;t write frameworks for dummies. [Frameworks designed by organizations] that assume some developers are not smart enough &#8230; are likely to fail because they underestimate the difficulty of &#8230; development. &#8230; 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&#8217;t write frameworks for dummies. [Frameworks designed by organizations] that assume some developers are not smart enough &#8230; are likely to fail because they underestimate the difficulty of &#8230; development. &#8230; 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&#8217;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>Some Design Up Front is Good</title>
		<link>http://adam.kahtava.com/journal/2008/12/18/big-design-up-front-is-good/</link>
		<comments>http://adam.kahtava.com/journal/2008/12/18/big-design-up-front-is-good/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 02:40:27 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[AJAX]]></category>

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

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

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

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,fb496d2c-e784-4cb1-8f55-bc32c87e2b73.aspx</guid>
		<description><![CDATA[
Like a horse with blinders on, avoiding some degree of Big Design Up Front (BDUF) can force your team and project into tunnel vision, because&#8230; If you don&#8217;t look at what you&#8217;re building in its entirety, it is harder to see the big picture, to have to that ah-hah moment that leads to a break [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; padding-left: 5px;"><a href="http://www.flickr.com/photos/preciouskhyatt/2653496191/sizes/l/"><img style="border: medium none ;" src="http://farm4.static.flickr.com/3266/2653496191_ed2e39e2fb_m.jpg" alt="" /></a></div>
<p>Like a horse with blinders on, avoiding some degree of <a href="http://en.wikipedia.org/wiki/Big_Design_Up_Front">Big Design Up Front (BDUF)</a> can force your team and project into tunnel vision, because&#8230; If you don&#8217;t look at what you&#8217;re building in its entirety, it is harder to see the big picture, to have to that <em>ah-hah</em> moment that leads to a break through, to maintain conceptual integrity, or have a successful project.</p>
<p>I worked on a project where we attempted evolutionary design (avoiding Big Design Up Front) while taking an Agile approach. We used Continuous Integration, and Test Driven Development. Looking back, our attempt at trying to avoid Big Design Up Front was fatal for our project&#8217;s success and probably our biggest mistake. The funny thing is, the only reason we avoided BDUF was because it seemed non-Agile (note the capital &#8216;<em>A</em>&#8216; in <em>&#8216;Agile&#8217;</em> read Yegge&#8217;s post <a href="http://steve-yegge.blogspot.com/2006/09/good-agile-bad-agile_27.html">Good Agile, Bad Agile</a> for the reference). As a development team we were inexperienced Agile (eXtreme Programming) teenagers and somewhere along the way we exchanged our brains for dogma.</p>
<blockquote><p>eXtreme Programming [is at odds with] &#8220;Big Design, Up Front&#8221; (BDUF) _ Because &#8220;Ya Ain&#8217;t Gonna Need It&#8221; (YAGNI) &#8230; [but this is often] taken as permission to not do any planning - <a href="http://xunitpatterns.com/gerardmeszaros.html">Gerard Meszaros&#8217;</a> Alberta TechFest slide deck &#8216;07</p></blockquote>
<p>In the past Big Design Up Front (BDUF) was associated with large inflexible architectural solutions that are designed upfront (before development begins) - like <a href="http://en.wikipedia.org/wiki/Waterfall_model">the waterfall methodology</a>. However; BDUF (like most techniques / methodologies / tools) are quite useful when used with a sprinkle of common sense and moderation. BDUF can be a productive lightweight tool for fleshing out the high level overview of a system. It is important to note that I&#8217;m not advocating Big <span style="text-decoration: underline;">Architectural</span> Design Up Front which is often composed of reams of documents, UML, ERDs, diagrams, and other unneeded artifacts. Instead I&#8217;m advocating for paper based story boards, wire frames, paper prototypes, user stories - anything that is easy to create, destroy, and recreate. These techniques provide the foundation of the final product, they start to verbalize the common product goal and can start to draw out the language, metaphors, and model that will eventually compose the project.</p>
<p>Avoiding some Design Up Front was a mistake for our project. As a team we were trying to cope with the complexities of our domain under very tight deadlines. Our code became increasingly brittle, we had overlooked obvious shared functionality that a high level overview would have fleshed out. At the same time we had segregated our application into sprint sized silos with no clear relationships - each sprint was essentially a two week tunnel, and disconnected.</p>
<p>Without some form of BDUF it was difficult to:</p>
<ul>
<li> maintain conceptual integrity, a common goal, a consistent user interface</li>
<li> estimate the whole product cost</li>
<li> have a successful project</li>
</ul>
<p>We should have headed Steve McConnell&#8217;s words:<em><br />
</em></p>
<blockquote><p>people were claiming,Â  &#8220;I don&#8217;t have to do requirements or design because I&#8217;m using object-oriented programming.&#8221; That was just an excuse. Most of those people weren&#8217;t really doing object-oriented programming-they were hacking, and the results were predictable, and poor. Right now, <strong>people are saying &#8220;I don&#8217;t have to do requirements or design because I&#8217;m doing agile development.&#8221; Again, the results are easy to predict, and poor</strong> - <a href="http://www.amazon.com/dp/0735619670">Steve McConnell</a><a href="http://tempuri.org/tempuri.html">, Code Complete</a></p></blockquote>
<p>Or perhaps Martin Fowler&#8217;s suggestion:</p>
<blockquote><p>the planned design approach has been around since the 70s, and lots of people have used it. It is better in many ways than code and fix evolutionary design. But it has some faults. - <a href="http://martinfowler.com/articles/designDead.html">Martin Fowler, Is Design Dead?</a></p></blockquote>
<p><strong>Not doing some Design Up Front is probably another excuse for being sloppy, but what do you think?<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/12/18/big-design-up-front-is-good/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&#8217;t do what WebForms can, should look to Rails as an example). <em>Gasp! It&#8217;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&#8217;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&#8217;m approached to work on an ASP.NET MVC project I might move back into ASP.NET. <strong>In the mean time I&#8217;d like to contribute to IronRuby as I work towards jumping my current technology stack. </strong>I&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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 &#8230; your favorite framework is going to be replaced.</strong> &#8230; I would love to see everybody learn a bunch of languages because it does make you a better programmer. &#8230; 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&#8217;ve ever landed on Amazon then you&#8217;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&#8217;ve ever landed on Amazon then you&#8217;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&#8217;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&#8217;t include all the details I wanted) and the wish list page still doesn&#8217;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 &#8216;A2JM0EQJELFL69&#8242; (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 &#8216;3JU6ASKNUS7B8&#8242; (the identifier after id= from the url).</em></li>
</ul>
<p>Once you&#8217;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&#8217;m assuming you&#8217;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&#8217;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 &#8230; 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 &#8230; 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>Cross Language Naming Conventions: Avoiding Verbosity In The Presentation Layer</title>
		<link>http://adam.kahtava.com/journal/2008/08/29/cross-language-naming-conventions-avoiding-verbosity-in-the-presentation-layer/</link>
		<comments>http://adam.kahtava.com/journal/2008/08/29/cross-language-naming-conventions-avoiding-verbosity-in-the-presentation-layer/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:17:38 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,3a071811-8e92-4511-a2e3-e4501864e82d.aspx</guid>
		<description><![CDATA[
Most languages and technologies used in web applications come with their own unique naming conventions - which is unfortunate, but necessary, because diversity is important. Languages like JavaScript and PHP use camelCase, CSS uses-hyphenated-delimiters, and ASP.NET / Java / and the like adhere to the conventions used in their respective libraries and frameworks. Managing the [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; float: right;"><a href="http://www.flickr.com/photos/jimmysmith/135368590/"><img style="border: 0px none ;" src="http://farm1.static.flickr.com/56/135368590_cb5abe1793_m.jpg" alt="" /></a></div>
<p>Most languages and technologies used in web applications come with their own unique naming conventions - <em>which is unfortunate, but necessary, because diversity is important</em>. Languages like JavaScript and PHP use <a href="http://en.wikipedia.org/wiki/CamelCase">camelCase</a>, CSS <em>uses-hyphenated-delimiters</em>, and ASP.NET / Java / and the like adhere to the conventions used in their respective libraries and frameworks. Managing the different naming conventions in a web application can be difficult, but with discipline, embracing each language&#8217;s conventions can provide some great benefits.</p>
<p>A common mistake I&#8217;ve made in the past, was trying to make all languages adhere to a single convention. <strong>As a budding PHP / ASP developer I took <em>the-single-convention-for-all-languages</em> approach</strong>. In retrospect, I used this approach because I didn&#8217;t completely understand the language I was using, and in order to compensate for this lack of knowledge, I&#8217;d try to meld the languages into the mental model I understood best. <strong>This was a mistake.</strong></p>
<p>Today, I find that working with the conventions of the language facilitates re-use (<em>experts in the language understand what I&#8217;m doing</em>), promotes portability (<em>modules can be used across projects regardless of server-side technologies</em>), encourages global collaboration (<em>open source modules and plug-ins can be easily consumed and contributed to</em>), and helps to a nurture a more maintainable application (<em>developers from other language domains can easily maintain the application with a relatively small learning curve</em>). Like a carpenter working with fine material, <strong>I embrace working with the grain of each language</strong>. It&#8217;s also fair to mention that breaking free from the monocultured (<em>one-size-fits-all</em>) approach to naming conventions provides a broader perspective, and also makes your development skills more universal - it might even open the door to different development domains in the future.</p>
<p>Then there&#8217;s the discussion on name length, verbosity, and using meaningful names. Steve McConnell suggests that the optimum name size for a variable or function is between 8 and 20 characters (Chapter 11, <a href="http://www.amazon.ca/dp/0735619670/">Code Complete</a>), but with tools like <a href="http://en.wikipedia.org/wiki/ReSharper">ReSharper</a> (for renaming / refactoring etc&#8230;) I find myself using names well over 30 characters. So names like <em>GetApproveeTotalFromNamedBasket</em> are a common occurrence in my code. However, like most things, verbosity does need balance (everything in moderation right?). In the business layer, descriptive names are a godsend - they jog my memory as I rediscover what the module I wrote last month was supposed to do. But&#8230; in the presentation layer languages (like JavaScript, CSS,Â  ASP.NET, or XHTML) you may want to reconsider using long descriptive names. Since verbose, long running descriptive names in the presentation layer are passed over the network and can degrade performance. Often times these verbose names are combined together - throw in ASP.NET name mangeling, start hooking in verbose CSS definitions, and then start inserting JavaScript events. All this compounds quickly and result in large page payloads filled with elements like the following:</p>
<pre><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">&lt;div id=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;">"ctl00_ContentPlaceHolderForAllTheBestImprotantContent
 _PanelForTheBestReviews"</span>&gt;Â </span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">&lt;a onclick=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;">"LinkButtonClick_ThankYouForTakingTheTimeToReadThis();"</span>Â </span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> id=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;">"ctl00_ContentPlaceHolderForAllTheBestImprotantContent_
 RepeaterForAllMyFavoriteBookReiews_ctl00_
 LinkButtonMarkReviewAsFavorite"</span>
<span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"> class</span>=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;">"LinkFormatingCssClass SelectedLinkFormatingCssClass"</span>Â </span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> href=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;">"javascript:__doPostBack(Â </span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;"> ctl00$ContentPlaceHolderForAllTheBestImprotantContent$Â </span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;"> RepeaterForAllMyFavoriteBookReiews$ctl00$LinkButtonMarkReviewAsFavorite'</span></span>
<span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px;"> ,'')"</span>&gt;Mark As Favorite &lt;/a&gt; </span></pre>
<p>Note: <em>That mess of code above would fire a JavaScript event then an ASP.NET event. It&#8217;s the result of</em><em> placing an ASP.NET LinkButton, inside a Repeater, inside a Panel, inside a Masterpage, and adding a JavaScript event along with some CSS. We can see that using long names in the presentation layers results in a mess of text. It&#8217;s also fair to mention that the <a href="http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework">ASP.NET MVC Framework</a> lets developers write cleaner presentation code.</em><br />
Sure, everyone cites <em>premature optimization as the root of all evil</em>, and we <strong>do</strong> live in a world of <a href="http://en.wikipedia.org/wiki/Gzip">gzip file compression</a> and JavaScript <a href="http://en.wikipedia.org/wiki/Minify">minifiers</a>. But&#8230; keeping names short in CSS, ASP.NET, and XHTML isn&#8217;t hard as long as you&#8217;re mindful of the final goal. Smaller names in the presentation layer will reduce the amount of data transferred over the network which increase the performance of the application.</p>
<p>Joseph Smarr of Plaxo.com once said:</p>
<blockquote><p>Web applications are only slow if you let them get slow - <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> [30:00]</p></blockquote>
<p><strong>My preference (project requirements warranting) is to keep things short and concise in the presentation languages while using longer descriptive names outside the presentation languages. What&#8217;s your preference?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/08/29/cross-language-naming-conventions-avoiding-verbosity-in-the-presentation-layer/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&#8217;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&#8217;s really wrong with ASP.NET AJAX?</strong></p>
<ul>
<li> It doesn&#8217;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&#8217;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&#8217;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&#8217;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&#8230; 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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;t recommend the ASP.NET AJAX Framework and won&#8217;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&#8217;s no need to whip a dead horse (I&#8217;ve probably been griping about the ASP.NET AJAX Framework for too long), but&#8230; 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&#8217;s no need to whip a dead horse (I&#8217;ve probably been griping about the ASP.NET AJAX Framework for too long), but&#8230; <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&#8217;d post a brief but choppy transcript:</p>
<blockquote><p>[ASP.NET AJAX] &#8230; 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> &#8230; 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&#8217;re more accustom with &#8230;</p>
<p>that&#8217;s wonderful, but I don&#8217;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> &#8230; That stuff is easy to do with an Update Panel and ASP.NET, but Update Panels aren&#8217;t always the best solution to use. &#8230;</p>
<p>the goals with ASP.NET AJAX was to integrate into the ASP.NET server-side model &#8230; that&#8217;s great for ASP.NET, but it needs more client-side features. &#8230; 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>&#8230;</p>
<p>ASP.NET AJAX [development] seems to have come to a standstill I&#8217;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 &#8230; 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>The Good Parts of The ASP.NET Framework and Visual Studio</title>
		<link>http://adam.kahtava.com/journal/2008/05/31/the-good-parts-of-the-aspnet-framework-and-visual-studio/</link>
		<comments>http://adam.kahtava.com/journal/2008/05/31/the-good-parts-of-the-aspnet-framework-and-visual-studio/#comments</comments>
		<pubDate>Sat, 31 May 2008 21:56:37 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

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

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

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

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,e724903b-65d4-4c94-a1bd-e704c9d80093.aspx</guid>
		<description><![CDATA[Douglas Crockford opens his latest book with these words:
Most programming languages contain good parts and bad parts. &#8230; [the language designers or architects] are usually powerless to do anything except heap more features on top of the existing pile of imperfections. And the new features do not always interact harmoniously, thus producing more bad parts. [...]]]></description>
			<content:encoded><![CDATA[<p>Douglas Crockford opens his latest book with these words:</p>
<blockquote><p><strong>Most programming languages contain good parts and bad parts</strong>. &#8230; [the language designers or architects] are usually powerless to do anything except heap more features on top of the existing pile of imperfections. And the new features do not always interact harmoniously, thus producing more bad parts. - <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/">JavaScript: The Good Parts by Douglas Crockford</a></p></blockquote>
<p>His words can apply to all programming languages and frameworks. Like the Microsoft .NET Framework, Visual Studio, Java, and Eclipse.</p>
<p>Bad parts in the ASP.NET Framework and Visual Studio:</p>
<ul>
<li> ASP.NET Themes and Skins</li>
<li> The ASP.NET AJAX Framework</li>
<li> ASP.NET / Visual Studio Inline Style Properties</li>
<li> Visual Studio Design View</li>
<li> ASP.NET and Visual Studio&#8217;s over dependency on XML configuration files</li>
</ul>
<p>It would be great if someone wrote a book outlining the good parts of ASP.NET and Visual Studio. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/05/31/the-good-parts-of-the-aspnet-framework-and-visual-studio/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&#8230; </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=&#8221;return false;&#8221; &#8230;</i>, or &lt;a <i>href=&#8221;Javascript: do something;&#8221; &#8230;</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&#8217;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&#8217;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 &#8230; ??? 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&#8217;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>Griping About Users: What&#8217;s Wrong With Forums?</title>
		<link>http://adam.kahtava.com/journal/2008/05/10/griping-about-users-whats-wrong-with-forums/</link>
		<comments>http://adam.kahtava.com/journal/2008/05/10/griping-about-users-whats-wrong-with-forums/#comments</comments>
		<pubDate>Sat, 10 May 2008 16:46:26 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

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

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

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,865a3c55-53e2-4824-9ad5-d6a4aba0ef4b.aspx</guid>
		<description><![CDATA[Forums or Newsgroups are a great way to expand your community, contribute to the greater development community, hone your communication skills, and stay grounded. However, forums can have a frustrating dark side. From what I can tell, the dark side of forums stem from the wide diversity of users.
On Forums we have:

 the normal users
 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Internet_forum">Forums</a> or <a href="http://en.wikipedia.org/wiki/Newsgroup">Newsgroups</a> are a great way to <a href="http://adam.kahtava.com/journal/2007/03/04/community-keeps-us-grounded-expand-your-community/">expand your community</a>, contribute to the greater development community, hone your communication skills, and stay grounded. However, forums can have a frustrating dark side. From what I can tell, the dark side of forums stem from the wide diversity of users.</p>
<p><strong>On Forums we have:</strong></p>
<ul>
<li> the normal users</li>
<li> the <a href="http://en.wikipedia.org/wiki/Newbie">newbies</a></li>
<li> the <a href="http://en.wikipedia.org/wiki/Troll_%28Internet%29">trolls</a></li>
<li> the users suffering from <a href="http://adam.kahtava.com/journal/2007/10/06/a-bad-case-of-information-fatigue-syndrome-ifs-just-living-the-high-tech-illusion/">information fatigue syndrome</a></li>
<li> full time employees who are paid to answer questions</li>
</ul>
<p>As a forum contributor, I like to think that I&#8217;m giving something to the community, but some days I feel like I&#8217;m wasting my time and here&#8217;s why.<br />
<strong><br />
Frustrating forum threads:</strong></p>
<p><strong>When contributors pass your words off as their own:</strong></p>
<p>Amanda from Microsoft offers this bit of advice on 08-28-2007:<br />
<a href="http://forums.asp.net/p/1150985/1877003.aspx"><img style="border: 0px none ;" src="http://adam.kahtava.com/journal/images/blog/forum_copied1.png" alt="" /></a></p>
<p>Which seems vaguely similar to something I might have said back on 12-07-2006:<br />
<a href="http://forums.asp.net/p/1052202/1489510.aspx"><img style="border: 0px none ;" src="http://adam.kahtava.com/journal/images/blog/forum_copied2.png" alt="" /></a></p>
<p><strong>When users are belligerent:</strong><a href="http://forums.asp.net/p/1247373/2300364.aspx"><br />
</a><br />
<a href="http://forums.asp.net/p/1247373/2300364.aspx"><img style="border: 0px none ;" src="http://adam.kahtava.com/journal/images/blog/forum_flame.png" alt="" /></a><br />
<em>&#8220;Adam has so little time he can&#8217;t even read your question &#8230;&#8221;</em> - Brian</p>
<p><strong>When users want a quick fix or want <span style="text-decoration: underline;">you</span> to do their work:<a href="http://forums.asp.net/p/1225090/2196013.aspx"><br />
</a></strong><br />
<a href="http://forums.asp.net/p/1225090/2196013.aspx"><img style="border: 0px none ;" src="http://adam.kahtava.com/journal/images/blog/forum_quickfix1.png" alt="" /></a></p>
<p><a href="http://forums.asp.net/p/1225090/2196013.aspx"><img style="border: 0px none ;" src="http://adam.kahtava.com/journal/images/blog/forum_quickfix2.png" alt="" /></a><br />
<em>&#8220;please verify and do for me some work.&#8221;</em> - dagamishiva</p>
<p>It makes it all worth while when users are genuinely grateful for your advice and suggestions. In the end, forums (and helping people in general) is rewarding, and some forums that explicitly cover more advanced topics omit the frustrating chatter and facilitate professional level discussions.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/05/10/griping-about-users-whats-wrong-with-forums/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&#8217;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&#8217;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&#8217;t learn or don&#8217;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&#8217;s only real problem is education</a>, so let&#8217;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&#8217;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>&#8220;don&#8217;t write a line of JavaScript&#8221;</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&#8230; err&#8230; 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&#8217;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 &#8216;J&#8217; in AJAX - &#8216;J&#8217; stands for JavaScript (that&#8217;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&#8217;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&#8217;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&#8217;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>&#8220;we recommend that&#8230;&#8221;</i>, <i>&#8220;because it makes no sense&#8230;&#8221;</i>, <i>&#8220;you must rely on a special method&#8230;&#8221;</i>, <i>&#8220;you must understand X,Y,Z to run complex client-side code without writing a single line of JavaScript&#8221;</i> were discouraging. Many of the <i>&#8220;whys&#8221;</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>&#8220;the JavaScript code disappear&#8221;</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>The ASP.NET AJAX Learning Curve</title>
		<link>http://adam.kahtava.com/journal/2008/04/09/the-aspnet-ajax-learning-curve/</link>
		<comments>http://adam.kahtava.com/journal/2008/04/09/the-aspnet-ajax-learning-curve/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 14:36:06 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<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>

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

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,a8f6b8fe-dbc5-4963-a735-e92ad3b18d8b.aspx</guid>
		<description><![CDATA[The ASP.NET AJAX framework comes with a lot of baggage err&#8230; I mean&#8230; a huge learning curve when compared to other AJAX Frameworks like JQuery, YUI, Dojo, Prototype / Scriptaculous.
 Here&#39;s a running list of the technologies, and concepts you&#39;ll encounter when digging into ASP.NET AJAX: 

 ASP.NET 

 The Page Life Cycle
 The Control [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/ASP.NET_AJAX">ASP.NET AJAX</a> framework comes with a lot of baggage err&#8230; I mean&#8230; a huge learning curve when compared to other <a href="http://en.wikipedia.org/wiki/Ajax_framework">AJAX Frameworks</a> like <a href="http://jquery.com/">JQuery</a>, <a href="http://developer.yahoo.com/yui/">YUI</a>, <a href="http://dojotoolkit.org/">Dojo</a>, <a href="http://www.prototypejs.org/">Prototype</a> / <a href="http://script.aculo.us/">Scriptaculous</a>.</p>
<p> Here&#39;s a running list of the technologies, and concepts you&#39;ll encounter when digging into ASP.NET AJAX:<br /> 
<ul>
<li> ASP.NET<img src="http://adam.kahtava.com/journal/images/blog/ajax_logo.png" style="float: right;"> </li>
<ul>
<li> The Page Life Cycle</li>
<li> The Control Life Cycle</li>
<li> Web Controls</li>
<li> User Controls</li>
<li> View State</li>
<li> Session State</li>
<li> Events </li>
</ul>
<li> .NET / Classical Language </li>
<ul>
<li> Interfaces</li>
<li> Inheritance</li>
<li> Delegates</li>
<li> Multicast Delegates</li>
<li> Assemblies</li>
<li> Properties (Get / Set)</li>
<li> Constructors</li>
</ul>
</ul>
<p> In addition to these, you also have the technologies universal to all JavaScript libraries:<br /> 
<ul>
<li> JavaScript:</li>
<ul>
<li> Closures</li>
<li> Object Literals</li>
<li> JSON</li>
<li> Events</li>
<li> DOM Manipulation</li>
<li> Prototypical Inheritance</li>
<li> Constructors</li>
<li> XMLHttpRequest </li>
</ul>
<li> Cascading Style Sheets (CSS):</li>
<li> Web Services</li>
</ul>
<p> The <a href="http://en.wikipedia.org/wiki/ASP.NET_AJAX">ASP.NET AJAX</a> Framework is more complex than other <a href="http://en.wikipedia.org/wiki/Ajax_framework">AJAX frameworks</a>, I&#39;m continually lost in it&#39;s ambiguity as it attempts to skirt around the JavaScript language - I think this learning curve (and all it&#39;s confusion) is precisely why <a href="http://en.wikipedia.org/wiki/Silverlight">Silverlight</a> has so much potential.  </p>
<p> I&#39;m still diving into the low-level details, but my first impressions of the ASP.NET AJAX Framework are:  <br /> 
<ul>
<li> Obscure, ambiguous, no clear vision - it offers multiple (resource intensive) ways to avoid writing JavaScript, but then requires that you write JavaScript anyways </li>
<li> Too server centric</li>
<li> Too heavy weight (I&#39;m not appreciating how they&#39;re trying to turning JavaScript into a Java, C#, .NET clone, the overhead within the browser for these conversions seems like a huge performance bottleneck)</li>
<li> Has the potential for poor performance  </li>
</ul>
<p> Most of the <u>other</u> AJAX libraries have been written with performance, browser responsiveness, and User Experience as their number one priorities - I&#39;m still not sure about ASP.NET AJAX.  </p>
<p> How many ways can we try to avoid writing JavaScript? If an AJAX library doesn&#39;t enhance the User Experience then why use it? Regardless, I&#39;m still digging deeper.<br /> </p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/04/09/the-aspnet-ajax-learning-curve/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&#8217;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&#8217;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&#8217;s unfortunate that we can&#8217;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&#8230;.. <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&#8217;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:

 &#8220;I know what JavaScript is, I can learn JavaScript in 30 minutes&#8220;
 &#8220;JavaScript is for kids, it&#8217;s a toy language, it&#8217;s easy&#8221;
 &#8220;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&#8217;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>&#8220;I know what JavaScript is, </em><em>I can learn JavaScript in 30 minutes</em><em>&#8220;</em></li>
<li> <em>&#8220;JavaScript is for kids, it&#8217;s a toy language, it&#8217;s easy&#8221;</em></li>
<li> <em>&#8220;I just copy and paste my JavaScript snippets / scripts from the internet&#8221;</em></li>
<li> <em>&#8220;JavaScript is just another programming language like C++, C#, VB.NET, or Java&#8221;</em></li>
</ul>
<p>If thoughts similar to these have crossed your mind when sizing up your JavaScript knowledge, then you probably don&#8217;t know JavaScript.</p>
<p>I would argue that if you&#8217;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&#8217;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&#8217;t understand the fundamentals then you&#8217;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>&#8216;{}&#8217;</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>&#8216;nan&#8217;</em> (not a number) and <em>&#8216;undefined&#8217;</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=&#8221;Javascript:alert(&#8217;hello&#8217;);&#8221;</em>), and appreciate avoiding it.</li>
<li> You know how to avoid embedding DOM Level 0 JavaScript events (<em>&lt;a onclick=&#8221;alert(&#8217;hello&#8217;);&#8221;</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&#8217;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&#8217;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>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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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>&#8230; :) 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&#8217;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&#8230;) 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&#8217;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&#8217;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&#8217;ve been leary of using this method because it&#8217;s not a best practice, since it compromises the validity of the HTML [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;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&#8217;ve been leary of using this method because it&#8217;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&#8230;) 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&#8217;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>&#8230; 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;">=&#8221;text/css&#8221;&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&#8230; */</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;">=&#8221;listoflists_data&#8221;</span> <span style="color: red;">style</span><span style="color: blue;">=&#8221;display:none&#8221;&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;">=&#8221;paweather&#8221;</span> <span style="color: red;">class</span><span style="color: blue;">=&#8221;details&#8221;</span> <span style="color: red;">href</span><span style="color: blue;">=&#8221;r/wb/*-http://weather.yahoo.com/forecast/USKS0448_f.html&#8221;&gt;&lt;</span><span style="color: maroon;">span</span> <span style="color: red;">class</span><span style="color: blue;">=&#8221;icon&#8221;&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;">=&#8221;text/css&#8221;&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>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&#8217;s Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Style Sheets (CSS), but don&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; 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&#8217;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&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; 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&#8217;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&#8217;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;">&#8220;App_Themes/Default/PrinterFriendlyStyleSheet.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">&#8220;App_Themes/Default/StyleSheet.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">&#8220;App_Themes/Default/PrinterFriendlyStyleSheet.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">=&#8221;all&#8221;</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>=&#8221;App_Themes/Default/PrinterFriendlyStyleSheet.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <strong><span style="color: red;">media</span><span style="color: blue;">=&#8221;print&#8221;</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;">=&#8221;print&#8221;</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;">/*&#8230; your CSS here &#8230;*/</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(&#8221;/AppName/CSS/PrinterFriendlyStyleSheet.css&#8221;) Print;</span></p>
<p><strong>Discussion:</strong> This solution requires moving our Printer Friendly Style Sheet outside the Theme directory, since Themes don&#8217;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&#8217;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;">=&#8221;text/css&#8221;</span> <span style="color: red;">media</span><span>=<span style="color: #0000ff;">&#8220;print&#8221;</span>&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: green;">/*&#8230; your CSS here &#8230;*/</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&#8217;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&#8217;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&#8217;s Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0&#8217;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&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; 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&#8217;s Head tag to add the Style element into the Head of your Web Form (.aspx page). However, this solution doesn&#8217;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 &#8220;cascade&#8221; into a new &#8220;virtual&#8221; 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&#8217;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&#8217;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&#8217;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;">=&#8221;C#&#8221;</span> <span style="color: red;">EnableTheming</span><span style="color: blue;">=&#8221;true&#8221;</span> <span style="color: red;">AutoEventWireup</span><span style="color: red;">=&#8221;true&#8221;<br />
CodeFile</span><span style="color: blue;">=&#8221;MasterPage.master.cs&#8221;</span> <span style="color: red;">Inherits</span><span style="color: blue;">=&#8221;MasterPage&#8221;</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;">&#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> <span style="color: blue;">&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&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;">=&#8221;http://www.w3.org/1999/xhtml&#8221;</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>=&#8221;server&#8221;&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;">=&#8221;ContentPlaceHolderHead&#8221;</span> <span style="color: red;">runat</span><span style="color: blue;">=&#8221;server&#8221;</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;">=&#8221;form1&#8243;</span> <span style="color: red;">runat</span><span>=&#8221;server&#8221;&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 &#8220;Hello World!&#8221; between the H1 tags.</em></p>
<p class="MsoNormal"><strong>The default Web Form (.aspx page) providing the Content for the Master Page&#8217;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;">=&#8221;C#&#8221;</span> <span style="color: red;">Theme</span><span style="color: blue;">=&#8221;Default&#8221;</span> <span style="color: red;">MasterPageFile</span><span style="color: red;">=<span style="color: #0000ff;">&#8220;~/MasterPage.master&#8221;</span><br />
AutoEventWireup</span><span style="color: blue;">=&#8221;true&#8221;</span> <span style="color: red;">CodeFile</span><span style="color: blue;">=&#8221;Default.aspx.cs&#8221;</span> <span style="color: red;">Inherits</span><span style="color: blue;">=&#8221;Default&#8221;</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;">=&#8221;Content1&#8243;</span> <span style="color: red;">ContentPlaceHolderID</span><span style="color: blue;">=&#8221;ContentPlaceHolderHead&#8221;</span> <span style="color: red;">Runat</span><span>=<span style="color: #0000ff;">&#8220;Server&#8221;</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>=&#8221;text/css&#8221;&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;">&#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&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;">=&#8221;http://www.w3.org/1999/xhtml&#8221;</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>=&#8221;text/css&#8221;&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;">=&#8221;App_Themes/Default/StyleSheet.css&#8221;</span> <span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">=&#8221;aspnetForm&#8221;</span> <span style="color: red;">method</span><span style="color: blue;">=&#8221;post&#8221;</span> <span style="color: red;">action</span><span style="color: blue;">=&#8221;Default.aspx&#8221;</span> <span style="color: red;">id</span><span>=&#8221;aspnetForm&#8221;&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;">=&#8221;hidden&#8221;</span> <span style="color: red;">name</span><span style="color: blue;">=&#8221;__VIEWSTATE&#8221;</span> <span style="color: red;">id</span><span style="color: blue;">=&#8221;__VIEWSTATE&#8221;</span> <span style="color: red;">value</span><span style="color: blue;">=&#8221;&#8230;&#8221;</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) &#8220;Hello World!&#8221; 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 &#8220;Work Around&#8221; doesn&#8217;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 &#8220;Work Around&#8221; 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;">&#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&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;">=&#8221;http://www.w3.org/1999/xhtml&#8221;</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>=&#8221;text/css&#8221;&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;">=&#8221;App_Themes/Default/StyleSheet.css&#8221;</span> <span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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>=&#8221;text/css&#8221; </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;">=&#8221;screen&#8221;</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;">=&#8221;aspnetForm&#8221;</span> <span style="color: red;">method</span><span style="color: blue;">=&#8221;post&#8221;</span> <span style="color: red;">action</span><span style="color: blue;">=&#8221;Default.aspx&#8221;</span> <span style="color: red;">id</span><span>=&#8221;aspnetForm&#8221;&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;">=&#8221;hidden&#8221;</span> <span style="color: red;">name</span><span style="color: blue;">=&#8221;__VIEWSTATE&#8221;</span> <span style="color: red;">id</span><span style="color: blue;">=&#8221;__VIEWSTATE&#8221;</span> <span style="color: red;">value</span><span style="color: blue;">=&#8221;&#8230;&#8221;</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: &#8220;Hello World!&#8221; 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&#8217;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&#8217;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&#8217;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&#8217;s fairly intuitive and understandable</li>
<li> It&#8217;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&#8217;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&#8217;s Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0&#8217;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&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; 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&#8217;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;">=&#8221;http://www.w3.org/1999/xhtml&#8221;&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>=&#8221;App_Themes/Default/Controls/<strong>OverloadedUserWebControlStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=&#8221;App_Themes/Default/Controls/<strong>ReusedUserWebControlStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=&#8221;App_Themes/Default/<strong>OverloadedStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=&#8221;App_Themes/Default/<strong>ReusedStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">=&#8221;http://www.w3.org/1999/xhtml&#8221;&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>=&#8221;App_Themes/Default/<strong>aa_ReusedStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=&#8221;App_Themes/Default/Controls/<strong>01_ReusedUserWebControlStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=&#8221;App_Themes/Default/Controls/<strong>09_OverloadedUserWebControlStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</span> <span>/&gt;<br />
</span><span style="color: blue;">&lt;</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span>=&#8221;App_Themes/Default/<strong>zz_OverloadedStyleSheet.css</strong>&#8220;<br />
</span><span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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&#8217;s not intuitive _ a maintenance programmers nightmare - &#8220;I&#8217;m familiar with CSS, but how are the Cascading Style Sheets being loaded??&#8221;</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&#8217;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&#8217;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 (&#8217;.&#8217; Or &#8216;#&#8217;) 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;">=&#8221;Legacy&#8221;</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&#8217;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&#8217;t use &lt;xhtmlConformance mode=&#8221;Legacy&#8221;/&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&#8217;s Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0&#8217;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&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; 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;">=&#8221;print&#8221;</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&#8217;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;">=&#8221;print&#8221;</span>) - for more information on manipulating the HtmlHead class read <a href="http://weblogs.asp.net/pscott/default.aspx">Phil Scott&#8217;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;">=&#8221;App_Themes/Default/HandHeld.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">=&#8221;App_Themes/Default/Print.css&#8221;</span><br />
<span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">=&#8221;App_Themes/Default/Screen.css&#8221;</span><br />
<span style="color: red;">type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">=&#8221;App_Themes/Default/Default.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">&#8220;</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;">&#8220;</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;">=&#8221;App_Themes/Default/HandHeld.css&#8221;</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;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">&#8220;</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;">&#8220;</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;">=&#8221;App_Themes/Default/Print.css&#8221;</span> </span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: red;"> type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">&#8220;</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;">&#8220;</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;">=&#8221;App_Themes/Default/Screen.css&#8221;</span> </span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color: red;"> type</span><span style="color: blue;">=&#8221;text/css&#8221;</span> <span style="color: red;">rel</span><span style="color: blue;">=&#8221;stylesheet&#8221;</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;">&#8220;</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;">&#8220;</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&#8217;t use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Microsoft&#8217;s Conditional Comments</a></li>
<li> Can&#8217;t use the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">CSS @Import rule</a></li>
<li> Can&#8217;t use the <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">CSS @Media rule</a></li>
<li> Can&#8217;t easily use multiple <a href="http://www.w3.org/TR/REC-CSS2/media.html">CSS Media types</a></li>
<li> Can&#8217;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&#8217;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 - &#8220;I know CSS, but Where are the Media types defined and How are they controlled?&#8221;</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&#8217;s Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; since they contribute to software entropy before your [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0&#8217;s Themes and Skins have a number of design flaws - Themes and Skins depend almost entirely on Cascading Stye Sheet (CSS), but don&#8217;t fully support CSS - I&#8217;ve listed some &#8220;Work Arounds&#8221; for a couple design flaws. I don&#8217;t recommend any of these &#8220;Work Arounds&#8221; 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&#8217;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&#8217;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 &#8220;Work Arounds&#8221; 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;;"> &#8220;</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 &#8220;;</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;;"> &#8220;</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&#8221;;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;"> &lt;!&#8211;[if IE]&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> &#8220;StyleSheets/FixInternetExplorer_Quirks.css&#8221;;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&lt;![endif]&#8211;&gt;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&lt;!&#8211;[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> &#8220;StyleSheets/FixInternetExplorer7Quirks.css&#8221;;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&lt;![endif]&#8211;&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;">=&#8221;text/css&#8221;&gt;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;!<span style="color: maroon;">&#8211;</span></span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> &#8220;StyleSheets/HideNavigation.css&#8221;;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span> </span><span style="color: blue;">@Import</span> &#8220;StyleSheets/HideSearchBars.css&#8221;;</span><br />
<span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&#8211;<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&#8217;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&#8217;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&#8217;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&#8217;s nightmare, &#8220;I know CSS, but Where is the CSS folder?&#8221; or &#8220;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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;">&#8220;App_Themes/Default/StyleSheets/HideAdvertisments.css&#8221;;</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;">&#8220;App_Themes/Default/StyleSheets/HideBorders.css&#8221;;</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;;"> &#8220;App_Themes/Default/StyleSheets/HideMenus.css&#8221;;</span></p>
<p><strong>In conclusion</strong>; Themes have a number of design flaws which limit a significant portion of CSS&#8217;s mature feature set. Themes are OK for small web applications, but not recommended for large / complex applications. While there are &#8220;work arounds&#8221; for some of the issues on my list, implementing each &#8220;work around&#8221; 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&#8217;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&#8217;t fully support CSS - now that&#8217;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&#8217;t fully support CSS - now that&#8217;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&#8217;s functionality - I&#8217;ll discuss this is my next post. CSS has been with us for over a decade, it&#8217;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&#8217;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&#8217;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&#8217;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&#8217;s not a clear case of CSS vs Themes since you really can&#8217;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&#8230; 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&#8230;) 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&#8230;) 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 &#8220;<a href="http://www.w3.org/TR/html401/present/styles.html#h-14.3.1">alternate stylesheet</a>&#8221; 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&#8217;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&#8217;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&#8217;ve been using Cascading Style Sheets (CSS)Â since the mid 90&#8217;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&#8217;ve been using Themes and Master Pages (ASP.NET 2.0) [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">Cascading Style Sheets (CSS)</a>Â since the mid 90&#8217;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&#8217;ve been using Themes and Master Pages (ASP.NET 2.0) with CSS. Personally I don&#8217;t like how .NET automagically inserts the CSS file references into the header. Much of CSS&#8217;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&#8217;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&#8217;m a bit of a standards geek, but I like to thoroughly understand a technology rather than rely on wizards, etc&#8230;</p>
<p>By inserting the code below into a webpage&#8217;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;!&#8211;[if IE]&gt;</span><br />
<span style="font-family: 'Courier New'; color: #006400; font-size: x-small;">Â Â Â Â Â Â  &lt;link href=&#8221;IEQuirkFixFile.css&#8221; rel=&#8221;stylesheet&#8221;<br />
Â Â Â  Â Â Â  Â Â Â  type=&#8221;text/css&#8221; media=&#8221;all&#8221; /&gt;</span><br />
<span style="font-family: 'Courier New'; color: #006400; font-size: x-small;">&lt;![endif]&#8211;&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&#8217;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;">&#8220;HideAllNavigationalContent.css&#8221;</span> <span style="color: #ff0000;">rel=</span><span style="color: #0000ff;">&#8220;stylesheet&#8221;</span> <span style="color: #ff0000;">type=</span><span style="color: #0000ff;">&#8220;text/css&#8221;</span> <span style="color: #ff0000;">media=</span><span style="color: #0000ff;">&#8220;print&#8221;</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&#8217;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;">&#8220;text/css&#8221;</span><span style="color: #0000ff;">&gt;</span></span><br />
<span style="font-family: 'Courier New'; font-size: x-small;"><span style="color: #006400;">&lt;!&#8211; </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;">&#8211;&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 &#8216;atlas:ScriptManager&#8217;.Â 
 Source Error:Â  &#60;atlas:ScriptManager id=&#8221;ScriptManager&#8221; runat=&#8221;server&#8221; /&#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 &#8216;atlas:ScriptManager&#8217;.Â </p>
<p></strong><strong> Source Error:Â  &lt;atlas:ScriptManager id=&#8221;ScriptManager&#8221; runat=&#8221;server&#8221; /&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;">&#8220;<span style="color: blue;">Microsoft.Web.UI</span>&#8220;<span style="color: blue;"><br />
</span><span style="color: red;">Â Â Â  Â Â Â Â  assembly</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">Microsoft.Web.Atlas</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">tagPrefix</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">atlas</span>&#8220;<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;">&#8220;<span style="color: blue;">Microsoft.Web.UI.Controls</span>&#8220;<span style="color: blue;"><br />
</span><span style="color: red;">Â Â Â  Â Â Â Â  assembly</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">Microsoft.Web.Atlas</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">tagPrefix</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">atlas</span>&#8220;<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;">&#8220;<span style="color: blue;">AtlasControlToolkit</span>&#8220;<span style="color: blue;"><br />
</span><span style="color: red;">Â Â Â  Â Â Â Â  assembly</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">AtlasControlToolkit</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">tagPrefix</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">atlasToolkit</span>&#8220;<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>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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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=&#8221;C#&#8221; Inherits=&#8221;Global&#8221; %&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&#8217;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&#8217;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>Journals / blogs / weblogs for ASP.NET 2.0</title>
		<link>http://adam.kahtava.com/journal/2006/05/31/journals-blogs-weblogs-for-aspnet-20/</link>
		<comments>http://adam.kahtava.com/journal/2006/05/31/journals-blogs-weblogs-for-aspnet-20/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 06:50:21 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

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

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

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,6d5d7efb-3918-415d-8944-fff4815cd079.aspx</guid>
		<description><![CDATA[My brief search for an economical (ASP.NET 2.0) journal (weblog) revealed a couple popular options: dasBlog, Community Server 2.0, Drupal, and .Text.
Community Server 2.0 had a couple flavors ranging from: a free (restricted) Express edition, through to an Enterprise edition.
After struggling with Community Server documentation and already being weary of &#8220;free&#8221; editions - as they [...]]]></description>
			<content:encoded><![CDATA[<p>My brief search for an economical (ASP.NET 2.0) journal (weblog) revealed a couple popular options: <a href="http://www.dasblog.info/">dasBlog</a>, <a href="http://communityserver.com/">Community Server 2.0</a>, <a href="http://drupal.org/">Drupal</a>, and .Text.</p>
<p>Community Server 2.0 had a couple flavors ranging from: a free (restricted) Express edition, through to an Enterprise edition.<br />
After struggling with Community Server documentation and already being weary of &#8220;free&#8221; editions - as they usually have a catch somewhere - I moved onto the next option.</p>
<p>dasBlog a free, BSD-licensed weblog engine for the .NET Framework. I downloaded compiled and installed dasBlog, it worked, and met my requirements . Now - thanks to the dasBlog contributors - I can move on.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2006/05/31/journals-blogs-weblogs-for-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 &#8220;easy&#8221; 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 &#8220;easy&#8221; 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>
