asp.net图像没有显示 [英] asp.net image not displying

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

问题描述

所以在我将图像上传到服务器后,我将图像路径存储在数据库中的服务器上,我希望在加载时打开页面以显示图像,但是当我设置图像时,图像仍然不显示。



我的路径就像C:\ Uploads \ Photo = \\ XYZ.jpg



myImg .ImageUrl =C:\ Uploads \Photo \XYZ.jpg

So after I upload the image to the server i store the image path on server in database and I want when open the page on load to display the image but when i set the imageurl the image is still not displayed.

my path is like C:\Uploads\Photo\XYZ.jpg

myImg.ImageUrl = "C:\Uploads\Photo\XYZ.jpg"

推荐答案

您应该只将文件保存在虚拟目录中并访问

检查这个...



http://stackoverflow.com/questions/275781/server-mappath-server-mappath-server-mappath-server-mappath [ ^ ]







http://www.dotnetgallery.com/kb/resource13-How-to-upload-a -file到Web服务器功能于ASPNET和商店文件路径 - 到 - data.a spx [ ^ ]
you should save your file in virtual directory only and to access
check this ...

http://stackoverflow.com/questions/275781/server-mappath-server-mappath-server-mappath-server-mappath[^]



http://www.dotnetgallery.com/kb/resource13-How-to-upload-a-file-to-web-server-in-aspnet-and-store-file-path-into-data.aspx[^]


这篇关于asp.net图像没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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