The directory structure and StyleSheets: The rendered XHTML:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>The Problems With Themes and Skins in ASP.NET 2.0 </title> <link href="App_Themes/Default/Controls/OverloadedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/Controls/ReusedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/OverloadedStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/ReusedStyleSheet.css" type="text/css" rel="stylesheet" /></head> The results in a web browser:
The rendered XHTML:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>The Problems With Themes and Skins in ASP.NET 2.0 </title> <link href="App_Themes/Default/Controls/OverloadedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/Controls/ReusedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/OverloadedStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/ReusedStyleSheet.css" type="text/css" rel="stylesheet" /></head>
The directory structure and StyleSheets:Note: the use of alphanumeric delimiters preceding the Style Sheet names. The rendered XHTML:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>The Problems With Themes and Skins in ASP.NET 2.0 </title> <link href="App_Themes/Default/aa_ReusedStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/Controls/01_ReusedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/Controls/09_OverloadedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/zz_OverloadedStyleSheet.css" type="text/css" rel="stylesheet" /></head>Note: the ordering of the CSS files.The results in a web browser:
The rendered XHTML:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>The Problems With Themes and Skins in ASP.NET 2.0 </title> <link href="App_Themes/Default/aa_ReusedStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/Controls/01_ReusedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/Controls/09_OverloadedUserWebControlStyleSheet.css" type="text/css" rel="stylesheet" /> <link href="App_Themes/Default/zz_OverloadedStyleSheet.css" type="text/css" rel="stylesheet" /></head>Note: the ordering of the CSS files.
Cons:Being a work around it's not intuitive – a maintenance programmers nightmare - “I'm familiar with CSS, but how are the Cascading Style Sheets being loaded??”Contributes to a fragile environment - the way ASP.NET parses through the App_Themes directories may change in newer versions of ASP.NET, not to mention changing a filename could have negative side effects on the site's design.Pros:Allows a load order to be definedCompatible with Revision Control Systems