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
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).
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.