webforms - What is the difference between Image Attribute and ImageURL in ASP.NET? -
i have googled , crawled couldn't find reliable info.
what difference between changing photo source of image in asp.net by
myimage.attributes["src"] = "/files/image1.jpg";
and
myimage.imageurl = "~/files/image1.jpg";
the imageurl attribute has advantage can use ~ character, stands application root.
myimage.imageurl = "~/files/image1.jpg";
this useful in cases root of application in subfolder , don't need hard code folder's name in code.
Comments
Post a Comment