某种类型的图像url

本文关键字:图像 url 类型 种类 | 更新日期: 2023-09-27 18:00:31

我有两行这样的代码:

<img height="100" width="100" src="../uploadimages/18-2-2013-23-33-01-Lighthouse.jpg">
<asp:Image id="img_prev" name="img_prev" src="" Height="80" Width="100" runat="server" />
img_prev.ImageUrl = "../uploadimages/18-2-2013-23-33-01-Lighthouse.jpg"

我尝试在2个html图像和.net图像中显示图像,在html代码中它显示商品,但在.net图像中它不能显示给图像。

某种类型的图像url

尝试使用此

<asp:Image id="Img1" runat="server" Height="80" Width="100" ImageUrl="../uploadimages/18-2-2013-23-33-01-Lighthouse.jpg" />

或删除src=""

您尝试使用asp图像控件是有原因的吗?通常,只有当您需要访问服务器端的控件时,才需要使用它。

试试这个。

img_prev.ImageUrl = "~/folder/filename";