Solved

Master page background images

Posted on 2006-11-16
10
457 Views
Last Modified: 2008-10-20
I have a  
about.aspx,
MasterPage.master,
images<------------ folder containing the images
pages<-------------folder containing web pages
all located under my root directory.

The about.aspx shows perfect with masterpage.master; however, if I pull up any other page under the pages folder the background images for the masterpage are not displayed.

I believe the problem is how the image location is specified, but then again, it may be something I haven't thought of yet.

Here is the code located on my masterpage.master
<td  style="background-image: url(images/blue-gradient.gif);">
 

How do I fix this?


Thanks
0
Comment
Question by:samme
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 9

Expert Comment

by:kraffay
ID: 17960388
You need to use a relative path:

url(/images/blue-gradient.gif)

if that doesn't work, try this:
url(../images/blue-gradient.gif)

0
 
LVL 1

Author Comment

by:samme
ID: 17960434
Nope didn't work. Thank you for the suggestion.

I've tried your suggestions plus

url(~/images/blue-gradient.gif)
url(~\images/blue-gradient.gif)
and
url(\images/blue-gradient.gif)
0
 
LVL 9

Accepted Solution

by:
kraffay earned 125 total points
ID: 17960579
I got this [../images/] to work on my page, but i have this structrure:

-- >Root
         ------>Masterpage.master
--> Pages
         ------>Child page
--> Images
         ------>background.gif

Can you put your master page in the same folder as your pages?

0
Industry Leaders: 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!

 
LVL 1

Author Comment

by:samme
ID: 17960817
There are quite a few folders under the root, one for each security setting.  So, I would need to recreate the masterpage under about 15 different folders.

I have tried placing the master page in its own folder....this didn't work.  
0
 
LVL 9

Expert Comment

by:kraffay
ID: 17960869
Can you put a class in your stylesheet with this attribute:

background-image: url(images/blue-gradient.gif);

and reference that stylesheet in your master page?
0
 
LVL 12

Expert Comment

by:UnexplainedWays
ID: 17961397
Can you try the full path?

<td  style="background-image: url(http://There are quite a few folders under the root/images/blue-gradient.gif);">
0
 
LVL 12

Expert Comment

by:sandip132
ID: 17962858
To get the actual path... Simply add one Image control on your form... then add the image path  from the "imageurl" property. You will get the path, just copy paste in :
<td  style="background-image: url(images/blue-gradient.gif);">
0
 
LVL 1

Author Comment

by:samme
ID: 17965377
kraffay... the class showed the image in the master page, but not the other pages

unexplainedways...  the full path doesn't show the image at all

sandip132...  the imageurl would be <td  style="background-image: url(~/images/blue-gradient.gif);">; this doesn't show the image at all

Thanks
0
 
LVL 12

Expert Comment

by:UnexplainedWays
ID: 17970042
"the full path doesn't show the image at all"

then you have bigger problems, have you managed to get it working at all?
0
 

Expert Comment

by:buchholt
ID: 22762649
Try to read this imformation about MasterPages and Site Directory Structure

http://msdn.microsoft.com/en-us/magazine/cc163967.aspx

 
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
How to create an MVC5, Razor Widget 2 37
How to design the database - Asp.net mvc code first entity framework 1 63
Finding the IIS version 5 37
Json and ajax 1 19
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

762 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