spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / asp / site_appearance2
[next]

Shared Application Infrastructure Project Manager
The Computer Merchant, Ltd
US-MA-Boston

Justtechjobs.com Post A Job | Post A Resume
Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies


Customizing and Managing Your Site's Appearance - Part 2

Randy Connolly

Digg This Add to del.icio.us

Creating a Sample Page with Two Themes

To finish our coverage of themes, let's examine an example that demonstrates the dynamic selection of themes. The example page contains a drop-down list that allows the user to select one of two different themes to be applied to that page. The markup for this page is shown in Listing 6.3. Notice that the page contains no appearance markup, only structured content. All formatting is contained in the theme skins and CSS files.

Listing 6.3ThemeTester.aspx

The markup contains a drop-down list that allows the user to select the theme. The code-behind for the page performs this processing, as shown in Listing 6.4.

Listing 6.4 ThemeTester.aspx.cs

By keeping your markup devoid of appearance formatting, it can be quite radically transformed by your themes. This example has two different themes: one called Cool and the other called Professional. Figure 6.7 illustrates how this page appears in its two themes (the Cool theme is the one on the right with two layout columns).

The skins for these two themes (shown in Listings 6.5 and 6.6) are quite similar as well as quite straightforward. Notice that both skins delegate the actual formatting to each theme's CSS file.

Listing 6.5 Cool.skin

Listing 6.6 Professional.skin

home / programming / asp / site_appearance2
[next]

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji

URL: