Solved

Change Theme in web.config with button click event

Posted on 2006-11-20
5
537 Views
Last Modified: 2008-02-01
Hello, I'm learning about themes and have creted two themes: blue and green. I have set the initial theme to blue in the web.config with this:       <pages theme="blue">

I have two buttons on a master page one for green and one for blue. How can I switch between themes with the button's click event?
0
Comment
Question by:gogetsome
  • 2
5 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 17980699
You can change programmatically the theme using such code:

case "Blue":
            Page.Theme = "BlueTheme";
            break;
        case "Pink":
            Page.Theme = "PinkTheme";
            break;

regards
0
 

Author Comment

by:gogetsome
ID: 17981023
Thanks mmarinov for your post. Yes, that method (page.theme = "Blue") would work if in the Page_PreInit event but the master page does not have that option and I want to be able to change all of the pages loading into the master page to reflect which theme the user selects. A good example it the www.msn.com.
0
 

Author Comment

by:gogetsome
ID: 17981087
Here is a good solution to my problem if anyone is interested. I added my skins to his example and it's all good.

http://staff.develop.com/ballen/blog/PermaLink.aspx?guid=09befce7-f48e-4555-891c-13818fd75a56
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 18449374
PAQed with points refunded (500)

DarthMod
Community Support Moderator
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to refer to value 8 78
Object Oriented Programming, C#, referencing, scoping. 13 83
asp web application 3 36
ASP.net Moving Visual Studio 2015 project to 2017 2 34
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question