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.
精彩评论