Applying themes to html

S

Shimon Sim

I have a master page that has a table. The table represents a banner.
I need to change background images for the cells depending on the page
theme.
I set up css and defined styles with background -image: url(...). I set up
images in theme folder and it didn't work. Then I decided to move images to
root and it didn't work either (the page in not in root. May be for root
pages it would help but I can't put all pages in root anyway).

Is there any solution for this?
Thanks.
Shimon.
 
S

Steven Cheng[MSFT]

Hi Shimon,

Welcome to the MSDN newsgroup.

From your description, I understand that you're using the theme in one of
your ASP.NET 2.0 web application. Also, the theme include a css style sheet
and one of the classes in it use a background image, however, you're
suffering problems on how to make the actual page resolve the relative url
in css style sheet correctly(no matter what folder hierarchy are they
located), correct?

Based on my research, this is a difficult problem because the ASP.NET
Theme/skin setting mostly apply on server control's control tag and the
attributes, and the theme folder specific path also only appliable to
server control's image attributes. For normal css style sheet, the image
path in it still be parsed by the client-side browser (according to the
actual page's url address). So far we can consider the following
approaches to workaround this problem when using style sheet (css) that
using relative url path:

1. We can consider use IIS site specific absolute path, which start with
"/", this means the path is an absolute path and start from the IIS
website's root. The drawback is that if the application is not deployed in
IIS site root(or the image resources are not deployed at IIS Site root), we
have to specify the application's virtual dir name in the image path also.

2. Instead of using the raw html element, we can consider using ASP.NET
Table server control, thus, we can use the skin file to define the table's
template.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top