views:

38

answers:

2

I need to change website theme (css) by clicking button on Master Page.

   protected virtual CSSClick (_sender : object,  _e : System.EventArgs) : void
   {
       //Session("Theme") = "Advanced";
   }

Google & MSDN didn't gave me the answer :( So no matters on C# or VB.NET , just how to make it ?

thank you.

+1  A: 

If it's just based on CSS then I suppose you could wrap the CSS link tags in placeholder controls and show/hide them accordingly in the button click event.

David
erm... how ? can't catch your idea.
nCdy
Based on your description I'm assuming that the button and the CSS tags are all on the master page, correct? If that's the case, then you can put the CSS tags in a PlaceHolder control (or just wrap them in a conditional if you're using MVC, which would be recommended over WebForms any day). Then in the method that handles the button click you can set that PlaceHolder's .Visible property to true/false accordingly (or update the conditional in the MVC View).
David
+1  A: 

I remember that Marco Bellinaso explained this in his book ASP.NET 2.0 website programming (problem-design-solution). In the book he is building a website called the Beerhouse. The source code for the Beerhouse project is is on codeplex:

http://thebeerhouse.codeplex.com/releases/view/127

Roger
yeah ... I also saw something like that on DotNetNuke, but that's hard and big projects. Maybe I will look for solution there some later.
nCdy