Introduction
We have lots of choices to work with Themes management. Rather than add the
Theme or StyleSheetTheme attribute to each and every page to which we want to
apply a Theme, we can register a Theme for all pages in your application in the
web configuration file.
The Web.Config file given below applies the Site Theme to every page in an
application.
Web.config Code
<?xml
version="1.0"?>
<!--
For more information
on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation
debug="true"
strict="false"
explicit="true"
targetFramework="4.0"/>
<pages
theme="Simple"
/>
<!--or
<pages styleSheetTheme="Simple" />
-->
</system.web>
</configuration>
In above configuration file I have used <page theme="Simple" />, we also can use
<pages styleSheetTheme="Simple" />. This tag helps to apply the theme in entire
pages. The code given below has even no <%@ Page Language="VB" Theme="Simple" %>
underlined tag but theme will work that is only because of configuration
settings.
Default.aspx Code
<%@
Page Language="VB"
AutoEventWireup="false"
CodeFile="Default.aspx.vb"
Inherits="_Default"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Join the conversation! Your thoughts help the community grow.