The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+
The page you are viewing does not exist in the .NET Core 3.0+ platform documentation. This link will take you to the parent topic of the current section.

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.2.dll

Declaration

public class ChooseThemeController :
    WindowController
Public Class ChooseThemeController
    Inherits 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.

Inheritance

Implements

See Also