我想在图像控件中显示文件夹中的图像。但图像没有显示。所以,请帮助我,我该怎么做....
Image1.ImageUrl = "E:\\Application\\Users\\" + Imagename;
答案 0 :(得分:0)
假设% set value [list "12" 14 2a "1a"];format x
x
% tcl::unsupported::representation [lindex $value 0]
value is a pure string with a refcount of 2, object pointer at 0x100874070, string representation "12"
% tcl::unsupported::representation [lindex $value 1]
value is a pure string with a refcount of 2, object pointer at 0x1008741c0, string representation "14"
% tcl::unsupported::representation [lindex $value 2]
value is a pure string with a refcount of 2, object pointer at 0x100874c40, string representation "2a"
% tcl::unsupported::representation [lindex $value 3]
value is a pure string with a refcount of 2, object pointer at 0x1008743d0, string representation "1a"
% tcl::unsupported::representation $value
value is a list with a refcount of 4, object pointer at 0x100874910, internal representation 0x1008eb050:0x0, string representation "12 14 2a 1a"
是网站所在的文件夹,您可以使用相对路径。
Users
或者,如果图片位于子文件夹Image1.ImageUrl = Imagename;
images
但是如果它是网站根目录之外的文件夹(并且从它可能的文件路径判断)那么这将不起作用。
答案 1 :(得分:0)
参考上面的答案,使用应用程序所在文件夹中的相对路径,并创建一个文件夹,即上传。像这样指向文件夹。
Image1.ImageUrl = "/Uploads/" + moneyReceiptUrl;
在视图中显示保存在文件夹中的图像。
<img src="../..@YourModel.Image1.ImageUrl" class="center-block">