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

ChooseThemeController Class

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

Namespace: DevExpress.ExpressApp.Web.SystemModule

Assembly: DevExpress.ExpressApp.Web.v19.1.dll

Declaration

public class ChooseThemeController :
    WindowController

Remarks

This Window Controller provides end-users with the capability to switch the ASP.NET application’s themes (see ASP.NET Web 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 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