Datasheet

page. For example, you can create a web page that contains login and password text boxes for registered
end users, and another set of controls for new end users to register with the web site. In this case, you
can use the validation group property to perform different actions, such as logging on to the web site
and registering an end user.
Themes
One of the neat features of ASP.NET 2.0 is themes, which enable you to define the appearance of a set of
controls once and apply the appearance to your entire web application. For example, you can utilize
themes to define a common appearance for all of the
CheckBox controls in your application, such as the
background and foreground color, in one central location. By leveraging themes, you can easily create
and maintain a consistent look throughout your web site. Themes are extremely flexible in that they can
be applied to an entire web application, to a page, or to an individual control. Theme files are stored
with the extension
.skin, and all the themes for a web application are stored in the special folder named
App_Themes.
The implementation of themes in ASP.NET 2.0 is built around two areas: skins and themes. A
skin is a set
of properties and templates that can be applied to controls. A
theme is a set of skins and any other associ-
ated files (such as images or stylesheets). Skins are control-specific, so for a given theme there could be a
separate skin for each control within that theme. Any controls without a skin inherit the default look.
There are two types of themes:
Customization themes: These types of themes are applied after the properties of the control are
applied, meaning that the properties of the themes override the properties of the control itself.
Stylesheet themes: You can apply this type of theme to a page in exactly the same manner as a
customization theme. However, stylesheet themes don’t override control properties, thus allow-
ing the control to use the theme properties or override them.
Characteristics of ASP.NET 2.0 Themes
Some of the important characteristics of ASP.NET 2.0 themes are:
Themes make it simple to customize the appearance of a site or page using the same design
tools and methods used when developing the page itself, thus obviating the need to learn any
special tools or techniques to add and apply themes to a site.
As mentioned previously, you can apply themes to controls, pages, and even entire sites. You
can leverage this feature to customize parts of a web site while retaining the identity of the other
parts of the site.
Themes allow all visual properties to be customized, thus ensuring that when themed, pages
and controls can achieve a consistent style.
As you read this, you might be wondering if themes are another variation of CSS
stylesheets. Themes are not the same thing as Cascading Style Sheets. Using
Cascading Style Sheets, you can control the appearance of HTML tags on the
browser. Whereas themes are applied on the server and they apply to the properties
of ASP.NET controls. Another difference is that themes can also include external
files, such as images and so on.
12
Part I: Introduction
05_041796 ch01.qxp 12/29/06 9:09 PM Page 12