Themes, Skins, and Masters

M

mike

Hi. I am having trouble grasping the concept of applying a consistent
theme to an ASP.net website. I didn't used to like ASP because it was
too hard to apply a theme from a common theme folder like I could do
easily in PHP, but now I see that it has some nicer theming features
and master files.

So I want to use web.config to switch which theme I'm using, and I
want to be able to have several themes. My understanding of themes is
that I can only define styling in them as I could with CSS, but I
can't define code for the header, footer, etc with them. And that's
where master files come in, right? I'd like to switch which set of
master files is in use as the theme changes. IE, I'd like to put
several master pages that match in looks but have different functions
in each theme's folder along with the skins. But I don't think that it
will automatically switch to those masters when the theme is switched
in web.config. Can I use a variable in the <%@ Page
MasterPageFile="... part? Specifically, can I include Page.Theme into
the middle of a path, like:

<%@ Page MasterPageFile="App_Themes/{Page.Theme}/m1.master" %>

I can't make the themes very varied if all I can edit is the skins and
they all have the same xHTML code.

Also, what is the difference between global themes in the /Themes/
directory and page themes in the /App_Themes/ directory?

So is this possible? Or am I thinking along the wrong lines to do such
a thing?

-Mike PII
 
C

clintonG

Briefly, we use the Page_PreInit event handler to change Themes and
MasterPages noting K. Scott Allen has documented the most helpful
information regarding this topic at http://odetocode.com/ but if you want to
master ASP.NET you need to delve into the page life cycle and learn it well
as it is fundamental to this and related tasks.

When using MasterPages you will also need to learn how to reference controls
which can be and is somewhat convoluted when using the FindControl method.
Try to get the hang of writing public properties to avoid using FindControl
when possible.

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

Mike P2

Briefly, we use the Page_PreInit event handler to change Themes and
MasterPages noting K. Scott Allen has documented the most helpful
information regarding this topic athttp://odetocode.com/but if you want to
master ASP.NET you need to delve into the page life cycle and learn it well
as it is fundamental to this and related tasks.

When using MasterPages you will also need to learn how to reference controls
which can be and is somewhat convoluted when using the FindControl method.
Try to get the hang of writing public properties to avoid using FindControl
when possible.

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

Thanks for your help. I finally got it down.

ASP.net is cool.

-Mike PII
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top