?
Solved

Change Theme in web.config with button click event

Posted on 2006-11-20
5
Medium Priority
?
540 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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 this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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