简体   繁体   English

Visual Studio 中的图像显示问题

[英]problem with image display in visual studio

I have got a strange problem.我有一个奇怪的问题。 Can somebody look into it please.有人可以调查一下吗。 I have a folder called "img" in my website.我的网站上有一个名为“img”的文件夹。 I added a new image to it.我向它添加了一个新图像。 Now the strange problem is that when I give img/imagename.extension it doesn't display in the browser.现在奇怪的问题是,当我给 img/imagename.extension 它没有显示在浏览器中。

I have tried even ~/img.我什至尝试过〜/ img。 But ended nothing.但什么也没有结束。 Actually I am using the image in the spark template.实际上我正在使用火花模板中的图像。 I have taken an existing image and tried, it displays the existing image but not the one I have added.我已经拍摄了一张现有图像并尝试过,它显示现有图像但不是我添加的图像。 I was expecting may be I need to check in the newly added image but even doing that didn't end up the result.我期待可能是我需要检查新添加的图像,但即使这样做并没有最终结果。

Any ideas????有任何想法吗????

Thanks谢谢

if you using Razor use @Url.Content("~/img/yourimage.ext")如果您使用 Razor 使用 @Url.Content("~/img/yourimage.ext")

  1. Check if authorisation rules of the folder img prevent the images from being shown eg to not authorised users.检查文件夹 img 的授权规则是否阻止图像显示给未经授权的用户。

  2. Check if the image file was properly added to the solution in the VS.检查图像文件是否已正确添加到 VS 中的解决方案中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM