Theme is similar to css, but it can provide features that css cannot provide.
--------------- The topic is based on controls rather than HTML (the topic allows setting and reusing almost all attributes)
--------------- The topic is applied on the server.
--------------- The topic can be applied through the configuration file.
--------------- The topic does not overlap like css (if a topic and space define attributes at the same time, the topic definition will overwrite the properties of the control, of course, this can also be modified)
The widget in the topic cannot define the ID.
Simple instance
1. Website --- add new item --- appearance file (suffixed with. skin) -- select "yes" to create an App_Themes \ skinName (folder of your topic name)
Set the control style in the file, for example:
Copy codeThe Code is as follows:
<% --
Set the source of the Panel. The following panel functions are used as examples.
1. Named control panel. SkinId should be unique, because in the same subject, a control type cannot have a duplicate SkinId.
[Code]
<Asp: GridView runat = "server" SkinId = "gridviewSkin" BackColor = "White">
<AlternatingRowStyle BackColor = "Blue"/>
</Asp: GridView>
2. Configure the panel. SkinId is not defined. In the same subject, each control plane must have only one Preset Control Panel.
<Asp: Image runat = "server" ImageUrl = "~ /Images/image1.jpg "/>
-- %>
<Asp: TextBox runat = "server" SkinId = "test" width = "20"/>
[/Code]
Use this topic on the page, for example, Theme = "name of your topic"
Copy codeThe Code is as follows:
<% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "WebForm1.aspx. cs"
Inherits = "Test22.WebForm1" Theme = "TestBox" %>
When using the control, you can set SkinID = "Your SkinID"
Copy codeThe Code is as follows:
<Asp: TextBox ID = "TextBox1" SkinID = "test" runat = "server"> </asp: TextBox>
If no SkinID is added to the two files, the topic is applied to all corresponding controls on the interface.