473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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 3470
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
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
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
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...
6
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 {...
1
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...
13
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...
1
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...
6
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...
3
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"...
5
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...
1
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...
3
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>...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.