Introduced
Using the theme feature of ASP.net 2.0, you can break down styles and layout information into separate filegroups, collectively referred to as "themes." The theme can then be applied to any site, affecting the appearance of pages and controls in the site. This way, you can easily maintain style changes to your site by changing the theme without having to edit the pages of the site. You can also share topics with other developers.
The essential
1, add the App_Themes folder to the Web site, you can add the. skin file, the. css file in each theme file (after you specify the theme, automatically load all the. css files under the theme) or picture files
2, under the web.config <system.web> element under the <pages> element to set the theme or StyleSheetTheme properties (for the global) Set the theme or StyleSheetTheme attribute in the page's @page directive (for the current page)
3, theme defined style can not be overridden; StyleSheetTheme defined styles can override
4,. skin file is not set SkinID is the default, set the SkinID SkinID properties of the corresponding control
5, dynamically modify the page theme to be implemented in the Page_PreInit method
Example
Blue Theme
<asp:label runat= "Server" backcolor= "Blue" forecolor= "white"/> <asp:label runat=
"Server" backcolor= Darkblue "forecolor=" white "skinid=" Dark "/> <%--imageurl the
following settings resolve to images files Pic.jpg folder under this topic--%>
<asp:image runat= "Server" imageurl= "Images/pic.jpg"/>
Red theme
<asp:label runat= "Server" backcolor= "Red" forecolor= "white"/> <asp:label runat=
"Server" backcolor= " Darkred "forecolor=" white "skinid=" Dark "/> <%--imageurl the
following settings resolve to images files Pic.jpg folder under this topic--%>
<asp:image runat= "Server" imageurl= "Images/pic.jpg"/>