. NET2.0 Themes and Skins

Source: Internet
Author: User
I read some online materials and sorted them out.

1. Apply Theme on one page:
To apply Theme to a Page, modify <% @ Page Theme = "..." %> In the aspx file.

2. Apply the same Theme on all pages:
If you want to use the same Theme on all pages, add <pages theme = "..."/> to the <system. web> node in web. config.

3. Do not apply Theme to the control:
You only need to set the EnableTheming attribute of the control to false.

4. Change the Theme of a page
To dynamically reference Theme in the background code to solve the above problem, you must write the code Page. Theme = "..." in the Page_PreInit event "...";

5. Change Theme (*) of all pages (*)
No real experiments have been conducted. The code written in Global. asax is as follows:
<% @ Application Language = "C #" %>
<Script runat = "server">
Void Page_PreInit (object sender, BrockAllen. Web. PageEventArgs e)
{
String t = HttpContext. Current. Profile. GetPropertyValue ("Theme") as string;
If (t! = Null & t. Length> 0)
{
E. Page. Theme = t;
}
Else
{
E. Page. Theme = "Default ";
}
}

</Script>
I need to study it carefully.

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.