Solved

2.0 Themes - .css file sets image location outside of theme folder

Posted on 2006-11-16
3
654 Views
Last Modified: 2008-03-06
I have a theme that uses a stylesheet.  All the images are uniform across themes so I want to have the images outside the theme folder.  How do i do this?

If its a resource i can go:

background-image:url(~/images/grad01.jpg);

or if its inside the theme I can set it like:

background-image:url(images/grad01.jpg);


this:   background-image:url(./images/grad01.jpg);   doesn't seem to work if the image folder is in the root of the web app.  How can I do this?

0
Comment
Question by:bswiftly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:ethoths
ID: 17956290
Whats wrong with...

background-image:url(~/images/grad01.jpg); ???
0
 
LVL 1

Author Comment

by:bswiftly
ID: 17956821
well, it doesn't work!

thats whats wrong. haha.

the ~ seems to be for files that are put in as a "resource".
0
 
LVL 11

Accepted Solution

by:
ethoths earned 20 total points
ID: 17956939
The "~/" only works for server controls. If you put the images folder in the root of your web then "/" should work. If not then you have to reference from the root "/MyWebRoot/".

If your website's address is http://localhost/MyWeb/ then you will have to include the "/MyWeb/" in your path. That or make all your images server controls.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question