Learn how to a build a cloud-first strategyRegister Now

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

ASP.NET server control Table: Can I set a background image? How to make the table fancier?

I found if I use Frontpage, etc to create a static table, I can change the background images easily. But with ASP.NET server control, I found I can't set the background images to the returing server produced tables. (I can change the background color though). Any idea about that? The reason I want this is because i have an application where the returned table will occupy half of the page area. I want to make this table fancier, more consistant with background. Seems I can't do everything as I did to make a fancy table as I did to static tables when I used Frontpage, DreamWeaver, etc.  Thanks for any suggestions.

-Scott
0
heyday2004
Asked:
heyday2004
  • 4
  • 4
2 Solutions
 
mmarinovCommented:
Hi heyday2004,

you can do the trick by using this:

htmlTable1.Attributes.Add("style", "background: url('/your image url')" )

Regards!
B..M
mmarinov
0
 
skpatraCommented:
for an asp:Table, you can use the BackImageUrl property at design/run time.
i.e.
Table1.BackImageUrl = "http://localhost/myimage.gif";
0
 
heyday2004Author Commented:
Thanks a lot for the answers. I tried both, there is no problem in compiling stage. But still, the table background image is not shown in the returned server table. Seems the background image is hidden or coverred. I really don't know now if we could change the background image of the server table now. My table is a very normal asp.net table. Three rows, each rows returns a row of the records in the database. Any hint is really appreciated. Thanks.
0
Industry Leaders: 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!

 
heyday2004Author Commented:
I mean, I can set the background images as shown above, but it's not what I expected, it only showed up at the border of the table, i.e. the table cell's background still not changed, what I want is a background image that can cover the whole table, and most importantly, it can be seen from user like the text are on the background images (we can do this in static page using Frontpage etc.). Any hint? Thanks a lot.
0
 
mmarinovCommented:
in what browser do you test your page ?

B..M
mmarinov
0
 
heyday2004Author Commented:
I am using IE6. The background image is set, but it is coverred by the front cells. Any idea? Thanks.
0
 
mmarinovCommented:
do you have set some syles or background images for the tablecells ?

B..M
mmarinov
0
 
heyday2004Author Commented:
Actually, no.
0
 
mmarinovCommented:
can you post the reulted HTML ?

B..M
mmarinov
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now