网站部署后未显示图像 [英] Images not been displayed after web site deployment

查看:60
本文介绍了网站部署后未显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


通过代码执行站点时,我可以看到所有的.jpeg和.gif图像,但是在Windows服务器中部署站点后,网页上的那些图像不会显示.
我给了source如下..

有关更新进度.

Hi,
I can see all the.jpeg and .gif images when I execute site through my code, but after site deployment in Windows server, those images on web page is not been displayed.
I have given sourece as below..

For update progress..

<asp:UpdateProgress ID="UpdateProgressMaster" runat="server">
        <ProgressTemplate>
            <panel>
            <img align="middle" src="/Images/ajax-loader_Wait.gif"  /></td>
            </panel>
        </ProgressTemplate>
    </asp:UpdateProgress>

For DIV

<div style="background-image: url('/Images/Main_Menubar.jpg');">


这里有什么问题吗?请提出任何建议.


Is there any issue here. Any suggetions please.

推荐答案

我的第一个猜测是图像未正确放置.

我的第二个猜测是您需要在相对地址之前使用波浪号来表示它相对于根,但是我相信在使用<asp:image></asp:image>之类的字符时它仅是必需的(建议吗?),并且不会影响标准标签.

我最后的猜测是,最初的正斜杠是多余的,可能会引起问题,但我认为不应该.
显然不是多余的,但仍然可能导致您遇到问题.请参阅Ankur \ m/的答案
My first guess would be that the images aren''t in the right place.

My second guess would be that you need a tilde before the relative address to say it''s relative to the root, but I believe that its only necessary (advisable?) when using <asp:image></asp:image> and the like and wouldn''t affect standard tags.

My final guess would be that the initial forward slash is superfluous and may be causing problems, but I don''t think it should.
Apparently not superfluous but could still be causing you problems. See Ankur\m/ ''s answer


在这种情况下,我通常要做的是检查图像的链接,然后尝试在另一个浏览器窗口/选项卡中打开它.如果您使用的是Firefox,只需右键单击损坏的图像链接,然后选择复制图像位置",否则您也可以签出页面源代码.在另一个窗口/选项卡中打开它,然后检查它是否起作用.


下面来自CodeProject中文章之一的答案的链接对其进行了很好的解释-
关于Asp.net初学者的路径"有什么 [ ^ ]

它说-
What I usually do for such cases is check the link of the image and try to open it in another browser window/tab. If you are using Firefox, just right click on broken image link and select "Copy Image Location" or you may check out the page source as well. Open it in another window/tab and check if that works.


The link to an answer below from one of the article here in CodeProject explains it very well -
There is something about "Paths" for Asp.net beginners[^]

It says -
A leading / character essentially means that the subsequent path is relative to the root of the web server, while the lack of a leading / means that the subsequent path is relative to the current page's directory.



因此,根据您的代码,Web服务器的根目录中必须存在"Images"文件夹.检查路径.

希望对您有所帮助!



So according to your code, "Images" folder must be present in the root of the web server. Check the path.

Hope that helps!


这是使用UpdateProgress并构建结构化网站时面临的最常见问题之一.

当然,听起来它仅是相对路径问题.我建议您使用此技巧并在设置图像源之前正确解析路径:
This is one of the most common issue faced while using UpdateProgress and having structured website.

Surely, sounds like it has to be relative path issue only. I would suggest you to use this Tip and resolve the path correctly before setting the image source: Resolving Paths in a Multi-Folder WebSite[^]

Doing something like this can also help:
<img src='<%=ResolveUrl("~/Images/Progress.gif")%>' align="absmiddle" />


这篇关于网站部署后未显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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