Preferred Language:
Listing 6.10 - Web.Config
Illustrates how you can apply a theme to every page in a folder or entire application.
<?xml version="1.0"?>
<configuration>
<system.web>
<pages theme="Site" />
</system.web>
</configuration>
The following configuration file applies a theme using the styleSheetTheme attribute instead
of the theme attribute (theme attributes can be overriden on the page).
<?xml version="1.0"?>
<configuration>
<system.web>
<pages styleSheetTheme="Site" />
</system.web>
</configuration>
The following page illustrates how you disable a theme configured in the web.config file
for an individual page.
<%@ Page Language="C#" EnableTheming="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Disable Page Theme</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label
id="Label1"
Text="Don't Theme Me!"
Runat="server" />
</div>
</form>
</body>
</html>
ASP.NET 3.5 Unleashed
- Containing almost 2,000 pages of code samples and in-depth explanation of the
ASP.NET 3.5 Framework, ASP.NET 3.5 Unleashed is the most comprehensive book
written on the ASP.NET 3.5 Framework.
ASP.NET 3.5 Unleashed is now available in your local bookstore and online (Published January 7, 2008).
All of the code samples from this book are hosted "live" at this website.
Click here
to view the table of contents and code samples.