Quantcast
Viewing all articles
Browse latest Browse all 7205

How to change a theme on-the-fly

This sample illustrates the possibility to change themes on-the-fly. The current theme is based on the Cookies value that is set in the client-side RadioButtonList.SelectedIndexChanged event handler.

See also:
ASP: How to change themes on-the-fly
MVC: Applying Themes
How to bind RadioButtonList to an enumerable property of Model

Question Comments

Added By: venu koneru at: 4/10/2015 8:09:37 AM    

where is Utils.CurrentTheme defined in the code. How to I change the theme in utils class at run time.

<!DOCTYPE HTML>
<html>
<head>
   <title>@ViewBag.Title</title>
   @Html.DevExpress().GetStyleSheets(
       new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme = Utils.CurrentTheme },
       new StyleSheet { ExtensionSuite = ExtensionSuite.Editors, Theme = Utils.CurrentTheme }
   )

   <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
   @Html.DevExpress().GetScripts(
       new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
       new Script { ExtensionSuite = ExtensionSuite.Editors }
   )
</head>
<body>
   @RenderBody()
</body>

Added By: Anthony (DevExpress Support) at: 4/10/2015 11:50:07 AM    

Hi Venu,

The CurrentTheme property is defined in the Utils.cs file located in the "Code" folder. I suggest that you run the example locally.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>