Page.Theme: The theme s style settings override (Crystaltech web hosting) any

Page.Theme: The theme s style settings override any local style settings. Page.StyleSheetTheme: Behaves more like a Cascading Style Sheet local style settings still take precedence over styles defined in themes. Choosing one option or the other is largely a matter of personal taste. The advantage of using Page.Theme is that you know that whatever is defined in the theme rules. You won t get any unpleasant surprises when a control or a chunk of text ignores the theme because you previously set some style that s now overriding your theme. The disadvantage to using Page.Theme is that if ever there was a need to override a theme-defined style for a particular control, there wouldn t be any way to do it, other than to create a special style rule for that one control. In the long run, you re probably better off sticking to the Page.Theme approach and allowing themes to take precedence. You don t want to end up with hundreds of controls on hundreds of pages, all doing their own things and ignoring your themes. That can just make using (not to mention maintaining) the site all the more confusing and more laborious. Defining a Site-Wide Default Theme In the code samples above, themes are applied to pages programmatically in the sense that code defines which theme is used for any given page based on the user s PreferredTheme property. At a higher level, you can define a default theme to be used by all the pages in your site. You do so in the Web.config file for your site using either of the following syntaxes:
where ThemeName is the name of a theme folder. For example, if you create a theme folder named DefaultTheme, and want to apply that theme to all pages in the site, you add the following line to your Web.config file:
Be sure to put the tag between the and tags in Web.config (as in Figure 10-18). Chapter 10: Using Themes 219
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply