[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

master page problem when using background image

ok i have a masterpage.master in the root of my website.
In this master page is a table, one of the table cells has a background image the style declaration for the TD has the url for the image as "/siteroot/images/background.jpg"
This works perfectly in IE6 even when the page served is folders deep in the app.
However when viewed in IE7 the BG image does not show even for pages that share the foldr with the masterpage! If I change the URL to "images/background.jpg" then both IE6 and 7 will show the image as it should.... until you view a page in a subfolder then neither versions will show it. I have added runat="server" to the TD tag but (as expected) no change.
The master page has other images with runat=server and the images show regardless of where you are in the site... how can I make sure that the TDs background image behaves the same?
0
QPR
Asked:
QPR
  • 6
  • 2
  • 2
  • +3
1 Solution
 
RedKelvinCommented:
can you specify full paths to the images, rather than using relative paths?
0
 
Sammy AgeilCommented:
why not use a CSS class instead?
0
 
Jai STech ArchCommented:
can you specify the FULL url
like <td background="http://localhost/ss/iamges/dd.gif"></td>
rather than just the image name...its always better
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
QPRAuthor Commented:
when you say full do you mean background:url("http://server/site/imaes/pic.jpg")
Or whatever the exact syntax is? haven't tried that, can't test till back at work.


use a class instead.....
Do you mean a style tag in the masterpage that deals with the single TD cell in question? Would that resolve it? would I need a runat="server" on the <style> tag? is that a valid attribute?
0
 
QPRAuthor Commented:
<td background="http://localhost/ss/iamges/dd.gif"></td>
I haven't tried this, will give it a go when back to work tomorrow
0
 
RedKelvinCommented:
yes full path, as in the http:// path.

This reduces flexibility, but certainly is safer
0
 
Bob LearnedCommented:
I had that problem, and I was able to use something like this with an asp:Image control:

~/images/background.jpg

Bob
0
 
QPRAuthor Commented:
Thanks Bob, I have image controls in the master page and they work perfectly no matter where you are in the site, it is the style of the TD that breaks when we go deeper than the sites root...

<TD style="width: 258px; height: 520px; background-image:url(/wanda/images/WandaSide.jpg); background-position: left top; background-attachment: fixed; background-repeat: no-repeat;" valign="top">
0
 
Bob LearnedCommented:
Why don't you put in an Image control within the <td> element?

<td><asp:Image /></td>

Bob
0
 
Jai STech ArchCommented:
i think...if you put a image control inside a TD then it does not become a back ground and becomes a control...

try something like this..
<TD background="http://yourdomainname/wanda/images/WandaSide.jpg" style="width: 258px; height: 520px;  background-position: left top; background-attachment: fixed; background-repeat: no-repeat;" valign="top">
0
 
QPRAuthor Commented:
"Why don't you put in an Image control within the <td> element?"

Because I have some text that sits ontop of the background image
0
 
QPRAuthor Commented:
"can you specify the FULL url
like <td background="http://localhost/ss/iamges/dd.gif"></td>"

No difference, seems to be an IE thing rather than an access/path thing
0
 
QPRAuthor Commented:
I removed background-attachment: fixed and all is fine now
0
 
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
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.

  • 6
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now