Skip to main content
.NET Framework 4.6.2+
  • The page you are viewing does not exist in the .NET 8.0+ platform documentation. This link will take you to the parent topic of the current section.

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChooseThemeController Class

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

Namespace: DevExpress.ExpressApp.Web.SystemModule

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

NuGet Package: DevExpress.ExpressApp.Web

#Declaration

public class ChooseThemeController :
    WindowController

#Remarks

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

ChooseThemeAction

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 Web Forms 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) {
    // ...
    WebApplication.Instance.Setup();
    BaseXafPage.CurrentThemeManager = null;
    WebApplication.Instance.Start();
}

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.

#Implements

See Also