Skip to Main Content
Programming ASP.NET 3.5, 4th Edition
book

Programming ASP.NET 3.5, 4th Edition

by Dan Maharry, Dan Hurwitz, Jesse Liberty
October 2008
Intermediate to advanced content levelIntermediate to advanced
1166 pages
28h 31m
English
O'Reilly Media, Inc.
Content preview from Programming ASP.NET 3.5, 4th Edition

Themes and Skins

Many users like to personalize their favorite websites by setting the look and feel of the site’s controls to meet their own personal aesthetic preferences. ASP.NET 3.5 provides support for themes that enable you to offer that level of personalization to your users.

A theme is a collection of skins. A skin describes how a control should look. A skin can define stylesheet attributes, images, colors, and so forth.

Having multiple themes allows your users to choose how they want your site to look by switching from one set of skins to another at the touch of a button. Combined with personalization, your site can remember the look and feel your user prefers.

There are two types of themes:

  • Stylesheet themes define styles that may be overridden by the page or control. These are, essentially, equivalent to CSS stylesheets.

  • Customization themes define styles that cannot be overridden.

You set a stylesheet theme by adding the StyleSheetTheme attribute to the Page directive, and similarly, you set a customization theme by setting the Theme attribute in the Page directive.

Tip

You can set the default theme for the entire website in web.config by adding the pages element to the system.web element within the configuration element, as follows:

<configuration>
   <system.web>
      <pages theme="Psychedelic" />
   </system.web>
</configuration>

Settings in the page will override those in web.config.

In any given page, the properties for the controls are set in this order:

  1. Properties are applied first ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Microsoft® ASP.NET 3.5

Programming Microsoft® ASP.NET 3.5

Dino Esposito
Learning ASP.NET 3.5, 2nd Edition

Learning ASP.NET 3.5, 2nd Edition

Brian MacDonald, Dan Hurwitz, Jesse Liberty
Pro ASP.Net 4 in C# 2010

Pro ASP.Net 4 in C# 2010

Matthew MacDonald, Adam Freeman, Mario Szpuszta
Programming .NET 3.5

Programming .NET 3.5

Jesse Liberty, Alex Horovitz

Publisher Resources

ISBN: 9780596156657Supplemental ContentErrata Page