Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Table Background image from usercontrol is not visible

Posted on 2006-07-13
7
Medium Priority
?
1,129 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 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