Solved

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

Posted on 2006-11-16
3
651 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
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Displaying a web form as a modal popup dialog box. 4 30
Message not shown 5 50
Creating a route in asp.net webforms 2 25
insert value of checklistbox checked 4 27
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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