开发者

Image control URL setting

I have an image control .NET.

<asp:Image ID="Image1" runat="server" />

How do I set the URL using code in C#, like

开发者_开发知识库{
  this.Image1.   
}  


Like this:

image1.ImageUrl = "~/Path/File.png";


If using database , <asp:Image ID="Image1" runat="server" ImageUrl = '<%#Eval("Field_db_of_image_path")%>' />, assuming you are saving image path in db not actually image in db.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜