在aspx页面中使用用户控件时如何设置图像路径显示? [英] How to set image path display when I am using user control in aspx page ?

查看:68
本文介绍了在aspx页面中使用用户控件时如何设置图像路径显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨每一个,





我有一个css课程,



Hi Every one,


I have one css class that is,

.Image1
{
    background-image: url(~/images/error-icon.png) no-repeat;
    background-repeat: no-repeat;
    width: 15px;
    height: 15px;
}









当这个css类用于用户控件(ascx页面)图像不显示。

没有浏览器显示图像。





任意解决方案回复我怎么解决这个问题.....





when this css class use in user control(ascx page) image not display.
none of the browser display image.


Any solution reply me how will solve this.....

推荐答案

它没有显示的原因是因为与CSS完全无关。删除它,你应该从网站的根目录中选择路径。
The reason it''s not displaying is because the ~ is absolutely nothing to do with CSS. Drop that and you should pick the path up from the root of the website.
.Image1
{
    background-image: url(/images/error-icon.png) no-repeat;
    background-repeat: no-repeat;
    width: 15px;
    height: 15px;
}


这篇关于在aspx页面中使用用户控件时如何设置图像路径显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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