VS 2005 Theming?

S

sstrangee

Maybe I don't get the whole theming thing... but here is what I'm
trying to do:

I have a App_Themes directory with a Theme named "Standard." Under
this theme a CSS named "standard.css" and also have a folder named
Images (which contains header_left.jpg and header_right.jpg).

In my project, I created a new directory called "Masterpages" and it
contains a master page named "Standard.master."

Also in my project, I created a directory called "Controls" which
contains a Web User Control named "Header.ascx" with a code behind of
"Header.ascx.cs".

I also have a file in the base directory named "default.aspx" with a
"default.aspx.cs" code behind page.

Pretty simple setup.

Now, in the Header control I've added an ASP Table control that
contains 1 row and 2 columns, 1 column is justified left, the other
right. Both columns have an ASP Image control within them. For
simplicty sake, I set the ImageURL on one image to
"images/header_left.jpg" and the ImageURL on the right image control to
"images/header_right.jpg" in the design view.

Now, I place this Header control on the Standard.master page (cause I
want it to show up on every page). I set the Header control to
EnableTheming to true in the properties.

I then associate the default.aspx to the Standard.master page. I set
the theme on the default.aspx page to "Standard" in the properties
pane.

When I run this project, the default.aspx can not find any of the
images and when I look at the source code it actually has a src on the
image of "controls/images/header_left.jpg" and
"controls/images/header_right.jpg" (not the path to the images).

What am I doing wrong that the images aren't being themed here?

I've even tried creating a propery so that I can se the ImageURLs from
the master page so that it might pass the correct path to control, but
that gives me the same results.

Am I missing something here?
 
C

clintonG

I didn't spend too much time analyzing your problem but as soon as I saw
your pathing it reminded me to inform you of the "root path operator" which
is used only on controls that runat="server" and as I recall on
directories...

~/controls/images/header_left.jpg

There's also a fair bit to be learned about StyleSheet Themes and the
application of style to controls. You may need to do some more searching and
finding of articles to read as it is a bit confusing.


<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
 
S

sstrangee

I have tried using the root operator "~", but that didn't seem to
select the correct them, but change the src to
/website/controls/images/header_left.jpg. Which is still the incorrect
path.

I want to mention that I also added [Themable(true)] to the class (that
didn't help).

I also try to add the user control the Standard.skin file in the Theme
using:

<%@ register tagprefix="cc" namespace="Controls.Header"
assembly="__code" %>
<cc:header runat="server" skinid="standard" />

But it throws these errors:
Could not load file or assembly '__code' or one of its dependencies.
The system cannot find the file specified.
Unknown server tag 'cc:header'.

If I change the assembly variable to a legit assembly (the one that
contains the control), I get the same error listed above but __code now
says the assembly name.

Maybe I'm just not getting how theming works with user controls...
 

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,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top