VS2005 Beta2 experience: Themes)

Source: Internet
Author: User
Themes allows your website to maintain a consistent style. Of course, you can also specify different Theme for separate pages or controls. Think about modifying the style of the entire website. You only need to modify the Theme file. That's a pleasure. Pai_^
 
 
If you don't talk much about it, you can use a simple Theme button to test the Theme. Note that the Custom Theme is used here ).
Select add new item, select a skin file, and click Add. If there is no App_Themes folder under the website, a prompt is displayed. As shown in the following figure:
 
Click yes to create the folder and file.
 
Open the skin file and add the following code to it:
The parameters in are easy to understand. The SkinId in it is an identifier. You need to select this ID when using the control. BackColor = "White" indicates the identifier when a control uses this SkinId, the BackColor of this control is White.
This is a simple Theme. Next we will make a page to call this Theme.
 
 
Create a page UseSkinPage. aspx, add a Server Button to the page, and select the Button attribute. Note the following two items: EnableTheming and SkinID. To EnableTheming the control to use Themes, set EnableTheming to True. SkinID is a SkinID in the skin file.
 
 
Before that, you need to set the Theme attribute in the Page. Otherwise, the path of the skin file cannot be found on the Page, and Theme cannot be used. After the correct Theme file is set, the SkinID item in the Button attribute can have the response content for you to choose from. On this page, of course, it is buttonSkin1.
The main code in UseSkinPage is as follows:
 
 
After a visit, we can see that the background of the Button is set to White.
 
 
In the skin file, you can have multiple skinids for controls of the same type. On the page, select different skinids.
 
 
If you want to apply a Theme to the entire website, you can add it under the section in the web. config file, so you do not need to use Theme = "themeName" in each Page. In this example, yes.
 
 
 
 
Another way to use a topic is to use StyleSheetTheme. StyleSheetTheme files are the same as those of customeme files, and the content in the StyleSheetTheme files can be the same, but there are some differences during the call.
 
 
 
 
Others:
1. There can be multiple Themes under the App_Themes Directory. You can select which one to use when using it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.