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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -