A newer version of this page is available. Switch to the current version.

ChooseThemeController Class

A WindowController descendant that provides the ChooseThemeController.ChooseThemeAction Action for ASP.NET applications.

Namespace: DevExpress.ExpressApp.Web.SystemModule

Assembly: DevExpress.ExpressApp.Web.v18.2.dll


public class ChooseThemeController :
Public Class ChooseThemeController
    Inherits WindowController


This Window Controller provides end-users with the capability to switch the ASP.NET application's themes (see ASP.NET Web Application Appearance).


A selected theme is persisted in user browser cookies. So, the theme will be applied every time a user runs the application.

How to Add More Themes

Refer to the How to: Use Custom Themes in ASP.NET Applications topic.

How to Disable Themes Selection

The ChooseThemeController Controller assigns a CookieCurrentThemeManager object to BaseXafPage.CurrentThemeManager property in its static constructor. If you want to disable this controller functionality, assign null (Nothing in VB) to BaseXafPage.CurrentThemeManager. Perform the assignment in the Session_Start method implemented in the Global.asax.cs (Global.asax.vb) file, after the XafApplication.Setup method is called.

using DevExpress.ExpressApp.Web.Templates;
// ...
protected void Session_Start(Object sender, EventArgs e) {
    // ...
    BaseXafPage.CurrentThemeManager = null;

Then, you can specify the required static theme in the Web.config file as described in the To a website section of the Apply a Theme with the DevExpress Mechanism topic.


See Also