Solved

Master page background images

Posted on 2006-11-16
10
456 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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…

831 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