Is this possible with themes?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

ASP.NET 2.0

I have developed a webpage which are using themes, the webpage contain a
dropdownlist where the user can select the theme for the page...

This webpage (.aspx) contain a table (asp:Table). Here is my problem I want
to completely change the layout of the table based on what theme is
selected. For example one of the table cells contain a image (server
control) and by selecting another theme then I want the image to appear in
another table cell in the table - completely changing the layout of the
table, not just setting colors and such things... Is it possible??

If this is possible then please explain me how to do it!

Jeff
 
maybe. themes only use css styles. if you switch from a table to divs,
then the css themes can control the layout.

-- bruce (sqlwork.com)
 
// Put the following into the Page_Load event and tell me what you see...
Page.Title = Page.Theme;

As you've learned we have to change the Theme from the Page_PreInit event
but we can access the current Theme from anywhere the Page is accessible.
Assuming you're using Visual Studio I have to ask if you've ever heard of
Intellisense :-) So build yourself a simple switch statement and put it into
the Page_Load event...

switch (Page.Theme)
{
case "Blue" :
// load the table you want here
break;
case "Green" :
// load the other table you want here
break;
default "Blue" :
// load the table you want as the default here
break;
}

Finally, before you get much deeper into the doo-doo you better do some
homework and learn the difference between the Theme and the StyleSheetTheme.
K. Scott Allen has documented both Master Pages and Themes extensively [1].

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

[1] http://odetocode.com/
 
Back
Top