Solved

Change Theme in web.config with button click event

Posted on 2006-11-20
5
528 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now