Demo download http://download.csdn.net/source/551037
You can define your own page subject or global topic. A topic consists of multiple supported files, including the style sheet of the page appearance, the control exterior of the modification server control, and any other supported images or files that constitute the topic.
Create a page topic
-
Create a new folder named app_themes on the website.
| Note: |
|
This folder must be named app_themes. |
-
Create a new sub-folder in the app_themes folder to save the topic file. The name of the subfolder is the topic name. For example, to create a topic named bluetheme, create a folder named \ app_themes \ bluetheme.
-
Add the appearance, style sheet, and image files that make up the topic to the new folder.
Create a global topic
-
Use the following path to create the themes Folder:
Copy code
Iisdefaultroot \ aspnet_client \ system_web \ version \ themes
For example, if the default web root folder is located in c: \ Inetpub \ wwwroot on the Web server, the new themes folder may be:
Copy code
C: \ Inetpub \ wwwroot \ aspnet_client \ system_web \ version \ themes
| Note: |
|
The folder Name of the global topic is themes rather than app_themes, because the latter is used for the page topic. |
-
Create a themes folder. The name of the subfolder is the topic name. For example, to create a global topic named bluetheme, you should create a folder named .. \ themes \ bluetheme.
-
Add the appearance, style sheet, and image files that make up the topic to the new folder.
Create appearance
-
Use the. Skin extension to create a new text file in the topic subfolders.
A typical convention is to create a. Skin file for each control, such as button. skin or calendar. Skin. However, you can create more or less. Skin files based on your needs. Appearance files can contain multiple appearance definitions.
-
In the. Skin file, add the general control definition (using declarative syntax), but only include the attributes to be set for the topic (property), not includingIDAttribute ). The control definition must containRunat = "server"Attribute.
The following example shows the appearance of the default button control andButtonControl defines the color and Font:
Copy code
<Asp: button runat = "server" backcolor = "red" forecolor = "white" font-name = "Arial" font-size = "9px"/>
| Note: |
|
One convenient way to create the appearance is to add the control to the page and configure it to make it have the desired appearance. For example, you can add the calendar control to the page and set its date header, selected date, and other attributes. You can then copy the control definition from the page to the appearance file and then remove it.IDAttribute. |
-
Repeat steps 2 and 3 for the appearance of each control to be created.
& Lt; table width = "100%" & gt; note
only one default appearance can be defined for each control. You can use the skinid attribute in the control Declaration to create a naming appearance that can be applied to a specific control instance.