图像不显示 [英] Image Not displaying
本文介绍了图像不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我使用文件上传控件将图像上传到服务器
So I uploaded the image To server using file upload control
Dim path As String = Server.MapPath("~/upload/Photo/")
FileUpload.SaveAs(path & ImageName & ".jpg")
和页面加载我正在显示图像
and on page load I'm displaying the image
img.ImageUrl = Server.MapPath("~/upload/Photo/") & ImageName & ".jpg"
但图像未显示!我在这里错过了什么???
But the image is not displayed! What did I miss here???
推荐答案
你好b $ b
Hi
Server.MapPath("~/upload/Photo/" & ImageName & ".jpg");
查看一次。
Check this once.
确保您具有读取放置文件的文件夹的所有权限。
权限描述这里 [ ^ ],
Make sure you have all the right permissions to read the folder where you place the file.
Permissions are described here[^],
我删除了Server.MapPath并且它工作正常:
img.ImageUrl =〜/ upload / Photo /&ImageName&.jpg
I removed the Server.MapPath and it worked:
img.ImageUrl = "~/upload/Photo/" & ImageName & ".jpg"
这篇关于图像不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文