C# 某种图像url
我有两行这样的话:C# 某种图像url,c#,asp.net,webforms,C#,Asp.net,Webforms,我有两行这样的话: <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-
<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"
img_prev.ImageUrl=“../uploadimages/18-2-2013-23-33-01-Lighthouse.jpg”
我尝试在2个html图像和.net图像中显示图像,在html代码中它显示商品,但在.net图像中它不能显示图像 您尝试使用asp图像控件的原因是什么?通常,只有在需要访问服务器端的控件时,才需要使用该控件 试试这个
img_prev.ImageUrl = "~/folder/filename";
试试这个
<asp:Image id="Img1" runat="server" Height="80" Width="100" ImageUrl="../uploadimages/18-2-2013-23-33-01-Lighthouse.jpg" />
或者删除
src=“”
请检查html页面中呈现的内容-在那里您可以看到未加载图像的原因。另外,您不需要将名称
作为属性放在asp:image上,我希望img_prev.ImageUrl
存在于code behind上。这与C有什么关系?不,我没有忘记。那是我第一次编辑。我只是好奇c代码在哪里。