在网页中使用时,不会显示控件中的图像 [英] in web userControl Images Not Dispaly When Use It In Pages
本文介绍了在网页中使用时,不会显示控件中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在UserControl中此代码使用:
< div 样式 =" >
< /div >
当在UserControl中的页面图像中使用此UserControl时并非偶然!???
usercontrol和Page的目录为diffrent
解决方案
使用此
< div 样式 =" < /div >
〜"是网站文件夹的根.
hi
in UserControl This Code Use:
<div style="width:200px;height:200px; background-color:Yellow; background-image:url(../Images/grafic.gif)" >
</div>
when Use this UserControl In Pages Image in UserControl Not Disaly!???
directory of usercontrol and Page is diffrent
解决方案
Use this
<div style="width:200px;height:200px; background-color:Yellow; background-image:url(~/Images/grafic.gif)"> </div>
''~'' refers to the root of website folder.
这篇关于在网页中使用时,不会显示控件中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文