First, Introduction:
With themes we can easily change the style of controls and pages without having to modify our code and page files. Themes files are separately placed under 1 App_Themes folders and are completely separate from your program.
Ii. How to use themes and skins:
Let's look at a very simple example:
App_themes\default\1.skin File Code:
<asp:Label Font-Bold="true" ForeColor="Red" runat="server" />
default.aspx:文件代码:
<% @ Page Language="C#" Theme="default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>Page with Example Theme Applied</title>
<body>
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Hello 1" /><br />
<asp:Label ID="Label2" runat="server" Text="Hello 2" /><br />
</form>
</body>
You can see that we didn't write a control style code in default.aspx, but running to find the word on the label became Bold Red, which is one of the most basic theme examples.
App_Themes folder:
The App_Themes folder is located under the root directory of the program, App_Themes must be a subfolder of the theme name, and a subfolder can contain multiple. Skin and. css files. The following figure establishes 2 theme, named Default and DEFAULT2: