mri*_*ula 3 iis-7 asp.net-mvc-4
网站中使用的图像存储在此处(在图像文件夹中) -

图像以这种方式引用 -
<img src="@Url.Content("/Images/greenDot.png")" style="margin-right: 10px;"/>
Run Code Online (Sandbox Code Playgroud)
当我在本地计算机上运行网站时,所有图像都可以正常加载.但是当我在IIS上部署并运行该网站时,没有任何图像被加载.
错误 -
Failed to load resource: the server responded with a status of 404 (Not found) http://54.234.60.214/Images/Logo_Innosolv.jpg
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.234.60.214/Images/Icons/bid.png
Run Code Online (Sandbox Code Playgroud)
什么似乎是问题?我是将图像移动到其他文件夹还是更改我在视图中引用它们的方式?
在路径中添加〜符号到图像.
<img src="@Url.Content("~/Images/greenDot.png")" style="margin-right: 10px;"/>
Run Code Online (Sandbox Code Playgroud)
如果您的网站中有身份验证,请检查该文件夹的路径是否具有公共权限.您必须在web.config中执行此操作.
| 归档时间: |
|
| 查看次数: |
27311 次 |
| 最近记录: |