【发布时间】:2018-01-08 08:02:05
【问题描述】:
我的问题与此非常相似:
Show images in Repeater control
该问题的选定答案是这样的:
<asp:Image ID="Image1" height="32" width="32" runat="server"
ImageUrl='<%# Eval("ImageUrl") %>' />
但是,就我而言,我有一个预先选择的文件名路径。这个我试过了,还是不行:
<asp:Image ID="Image1" height="32" width="32" runat="server"
ImageUrl='D:\MyPics\Photos\<%# Eval("PhotoLink") %>' />
Eval 不会转换为任何东西,当我在页面呈现后查看源代码时,它会说:
<img src="D:\MyPics\Photos\<%#Eval("PhotoLink")%
我确定这很愚蠢,但我想不通。
【问题讨论】: