473,804 Members | 3,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The background image for a table column is not getting displayed?

98 New Member
Here i use image in background in table column it does not displays the image but if i apply the same path for img tag in foreground it displays.

Here is code:
Expand|Select|Wrap|Line Numbers
  1. <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.     <style type="text/css">
  15.         .style1
  16.         {
  17.             width: 50px;
  18.             height: 323px;
  19.         }
  20.         .style2
  21.         {
  22.             width: 650px;
  23.             height: 323px;
  24.         }
  25.     </style>      
  26.  
  27. </head>
  28. <body>
  29.     <form id="form1" runat="server">
  30.     <div>
  31.     <table>
  32.     <tr>
  33.     <td style="width:30px; height:20px;">
  34.         <img src="Image/Blue%20hills.jpg" 
  35.             style="height: 83px; width: 734px;" />
  36.     </td>
  37.     </tr>
  38.     <tr>
  39.     <td>
  40.     <table>
  41.     <tr>
  42.     <td style="background-image:url('<%= ResolveUrl("~/Image/Bluehills.jpg") %>');"  class="style1">
  43.     <img src="Image/Water.jpg" height="60px" width="100px" />
  44.     </td>
  45.     <td class="style2" style="background-image:url('~/Image/Bluehills.jpg');">
  46.     <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
  47.  
  48.         </asp:ContentPlaceHolder>
  49.     </td>
  50.     </tr>
  51.     </table>
  52.     </td>
  53.     </tr>
  54.     <tr>
  55.  
  56.     <td>
  57.     reserved &copy; softech infoways
  58.     </td>
  59.     </tr>
  60.     </table>
  61.  
  62.     </div>
  63.     </form>
  64. </body>
  65. </html>
  66.  
  67.  
Feb 12 '11 #1
3 3495
Sudaraka
55 New Member
Check the HTML code rendered by this page, and make sure the output of <%= ResolveUrl("~/Image/Bluehills.jpg") %> is pointing to your image correctly.

And btw, is the IMG tag that works you reffed the same one you shown in the code above? because that and the background image name is different.
Feb 12 '11 #2
jagdeep gupta
98 New Member
Yes the same image was also tried but did not work now i got the tag to work but confused about functionality

i remove the tilde('~') symbol and image displayed but don't know why it does not work with tilde please help to understand.
Feb 13 '11 #3
Sudaraka
55 New Member
See if the details in following link helps you wit the ResolveUrl and tilde
http://www.dotnetspider.com/resource...ET-redire.aspx
Feb 13 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
4480
by: Jaz | last post by:
Hello all, I'd like to have a background image bleed of the right side of my page, but I don't want the page to stretch out with a scroll bar. How might I go about this? I can't make it a body background since I'm using Mambo as a CMS. Instead, this image is going to go into a content object which will be displayed on my front page. There will be a small flash object on top of the left side of the image, and the image will be wide...
6
3629
by: Peter Foti | last post by:
I have seen lots of examples where some HTML text is replaced with a background image using CSS. For example, replacing the text of an <h1> with a graphical logo, like so: CSS: h1 span { display: none; } h1 { height: 100px; background: url("mycompany.gif") no-repeat 35px 40px; } HTML: <h1><span>My Company</span></h1>
1
3313
by: RJ | last post by:
Hello! I am trying to lay out a left navigation column with a background image, where the left nav column runs the entire scrolled height/length of the page. The float:left column layout works fine, but the background image doesn't continue downward in this column below the links. I tried this in FireFox 1.0.7 and IE6, but this image stops where the last link stops. I want the background all the way to the bottom. How can I force...
13
3973
by: Giggle Girl | last post by:
Hi there, I need to use a background image in a TR that does NOT restart everytime it hits a TD. Can it be done? Specifically, if you set a background image for an entier table, now mater how many TRs and TDs you have, it will show the complete/unfragmented image (as long as you don't over-ride it). When I set a TR background image, every time I hit a TD it "re-seeds" the image. I want to have a TR that shows an 800px image in it's
1
1160
by: JoeClark | last post by:
I am using .Net Framework 1.1. I have used Image buttons (Server side) in the application. Image buttons are not getting displayed on the screen sometimes. Why it could be. The client browser is IE5.0? Please advice. Joe
6
2288
by: Akshay Sen | last post by:
..Net Frmaework 1.1, IE5.5+, IE settings ->Check for never versions of stored pages for "Every visit to the page" Question: I have used web control Image button. Sometimes the button (I mean Image) is not getting displayed on the page. Any suggestions? Thanks,
3
9397
by: Sridhar | last post by:
Hi, I have created a user control which has the html code as follows <TABLE id="ToolBarTable" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td align="right" bgColor="#000000"><IMG src="../Images/image1"> </td> </tr> <TR>
5
3169
by: Michael | last post by:
Is there a way to specify a background-image for a html table cell in a theme's css file. I know a lot of things I can't do... can't figure out one that I can do: 1) ~/ Images/logo.gif doesn't work since it isn't a server side control. 2) /Images/logo.gif doesn't work, not sure why. 3) Images/logo.gif doesn't work - This can work specify the style of the td element instead of the CSS class but then it isn't part of the theme. 4)...
1
3956
by: miranda | last post by:
I have a different table background image to be displayed for pages residing under different directories. I want the css script to indicate the table background image relative to each page. Each directory contains a subdirectory "/images" each of which contains a different image with the same filename "entryimage.jpg" Here's the css class I've got that is not relative: ****************** .bgentrypagepic { background-image:...
3
3221
by: jagdeep gupta | last post by:
i m using two images in master page in same row one image is displayed but not other plz check out code: <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%"> <tr> <td style="background-attachment: fixed; background-position-y: center; background-image: url('image/slam11.jpg'); color: #ffcccc; background-repeat: no-repeat; background-color: #ffcccc; " class="style1"> </td> <td...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.