动态设置html表背景图片 [英] set html table background image dynamically

查看:1245
本文介绍了动态设置html表背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有人可以告诉我如何在asp.net中以编程方式设置html表格背景图像.

我已将表格设置为runat="server".
并尝试此代码-

Hello guys,

Can somebody tell me how to set html table background image programatically in asp.net.

I have set my table as runat="server".
And trying this code -

tableid.Style.Add("background-image", "url('../App_Themes/DeviceImages/image.gif')");


但这不起作用.

在此先谢谢您.


But this is not working.

Thanks in advance.

推荐答案

它应该可以工作.只需检查您的图像路径即可.或尝试使用Page.ResolveUrl方法解析路径.
It should work. Just check your image path. Or try to resolve path using Page.ResolveUrl method.


尝试将URL作为
尝试此答案

希望其中一个网址有效…….
Try urls as
try this answer

hope one of the url works.......


这篇关于动态设置html表背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆