How to: Apply ASP.NET Themes Programmatically
In addition to specifying theme and skin preferences in page declarations and configuration files, you can apply themes programmatically. You can set both page themes and style sheet themes programmatically; however, the procedure for applying each type of theme is different.
Note
|
|---|
|
The themes referenced below are not included in ASP.NET. To create a custom theme, see How to: Define ASP.NET Page Themes. |
To apply a page theme programmatically
To apply a style sheet theme programmatically
-
In the page's code, override the StyleSheetTheme property and in the get accessor, return the name of the style sheet theme.
The following code example shows how to set a theme named BlueTheme as the style sheet theme for a page:
To apply control skins programmatically
Show:
Note