Solved

Table Background image from usercontrol is not visible

Posted on 2006-07-13
7
1,127 Views
Last Modified: 2012-05-05
HI,

I have a table in a usercontrol (ascx)that has a background images. The image it is not visible on the page (aspx) when the usercontrol is loaded.

The code from the control is as followed:

<table id="TABLE1" runat="server">
    <tr>
        <td align="center" style="background-image: url(../Styles/HeaderBg.gif); width: 400px;
            height: 40px; font-weight: bold; color: #848067; font-family: Arial;" id="TD1" runat="server">
            The text that is placed on the image</td>
    </tr>
</table>

0
Comment
Question by:bemiu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 14

Expert Comment

by:Ramuncikas
ID: 17106297
try setting background image not with style tag but with background tag. Like:
<td background="myimage.jpg">
0
 
LVL 14

Expert Comment

by:Ramuncikas
ID: 17106304
or try adding background-color:Transparent to style tag
0
 

Author Comment

by:bemiu
ID: 17106708
Hi Ramuncikas

Thanks for your reply !

The table doesn't have a property called "background" so I can't use that.  
The problem is loading a picture and not a #color. The color is loaded in the aspx page. :-)

0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 14

Expert Comment

by:Ramuncikas
ID: 17106734
I'm not talking about table (<TABLE>), I'm talking about tablecell (<TD>)
0
 

Author Comment

by:bemiu
ID: 17106813
Sorry...but it's the same for the cell. I have made a test page with a control and even it was not a property i ren the control on the page....nothing was shown
0
 
LVL 7

Expert Comment

by:irps20001
ID: 17107310
it must be showing an "x" icon in place of Image place. Just right click on the "x" ( where the image not showing ) and check for the Image properties, whether its loading from the proper place or is it going to somewhere to load the image. This may help

HTH
0
 
LVL 5

Accepted Solution

by:
bullrout earned 500 total points
ID: 17107620
hi There,

I'd be checking the path to the image just like irps20001 suggested.
Then i'd be more inclined to do this with a stylesheet. I have created a reference to a stylesheet and then placed the call to the image in it. When the page loads I have created a cell at runtime just as a place setter for the bg image to illustrate that the image is loading.

You can adapt the code to your needs, I hope this helps

Sean



make sure that the stylesheet reference is in the head of the document.

<style type="text/css">@import url( styles.css );
      </style>

!--- page code

<asp:Table id="Table4" runat="server"
                        BackColor="#ffffff" Width="412px" EnableViewState="False" BorderWidth="1" BorderColor="#F0027F"
                        Font-Size="8pt" Font-Name="Verdana" CellPadding="4" CellSpacing="0" Gridlines="Both"></asp:Table>

!--- stylesheet code

table
{
      background-image: url(images/bgmain.jpg);
}

!-- vb code

Dim r As TableRow = New TableRow
        Dim c As TableCell

        c = New TableCell
        c.Controls.Add(New LiteralControl("eeeeeee"))
        c.HorizontalAlign = HorizontalAlign.Center
        c.VerticalAlign = VerticalAlign.Top
        c.Width = Unit.Pixel(40)
        r.Cells.Add(c)
        Table4.Rows.Add(r)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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 this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

707 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