Skip to main content
A newer version of this page is available. .

Theming a Web Page or a Web Site

Theming a web page or an entire web site involves applying DevExpress AutoFormat as a theme for all web controls on the page.

For this purpose, the autoformat’s source files should be placed within the project’s App_Themes folder by using the ASPxThemeDeployer tool. From v2009 vol 2, it is only necessary to have the autoformat’s skin files within the project’s App_Themes folder; other required source files are automatically obtained from ASPxThemes Assembly.

To set the theme for the page, specify the page’s Theme property. This setting adds the Theme attribute assigned to the web page’s @ Page directive.

@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" 
Inherits="_Default" Theme="Glass" 

To theme an entire website, define the Pages element of the web.config file.

<system.web>
    <pages theme="Glass"></pages>
    ...
</system.web>

To theme a page programmatically, specify the theme name to the page’s Theme property within the server Page_PreInit event:


protected void Page_PreInit(object sender, EventArgs e) {
    ...
    this.Theme = "Glass";
    ...
}

It is also possible to theme a web page or website with a modified DevExpress AutoFormat (for more information, see the Customizing Theme Source Files topic).