Hi,

I want to load an image from the code-behind. I have the path of this image ("C:\somedironwebserver\somefileonwebserver.jpg") and i need to get the url (http://www.mysite/somefileonwebserver.jpg).
Currently I am combining strings to get get this URL but i think there must be a better way.

google didn't realy helped me. :(

User Server.MapPath Method.

Image1.ImageUrl=Server.MapPath("~/yourimagefile.jpg");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.