Change Theme in web.config with button click event

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?
Who is Participating?
DarthModConnect With a Mentor Commented:
PAQed with points refunded (500)

Community Support Moderator
You can change programmatically the theme using such code:

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

gogetsomeAuthor Commented:
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
gogetsomeAuthor Commented:
Here is a good solution to my problem if anyone is interested. I added my skins to his example and it's all good.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.