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.