Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with ImageURL property when using absolute File Path 1

Status
Not open for further replies.

mb22

Programmer
Sep 4, 2002
258
US
I have an image button on my ASP.Net form..... however the bmp image for the control does not show...

I know that relative path URL is best to assign the Image property but my pictures are not in the path of the web site so I have to use absolute path.

ImgProduct.ImageURL="file:///" & "D:\Product\Images\orange.jpg"

It works on my development machine .. but not the server...

Do I need "file:///" when specifying the absolute path? I guess having URL in the property name ImageURL is confusing me.
 
file:///

is not valid for websites. It will only work on development machines, and should always be avoided. It refers to files on the client, which is why it won't work anywhere other than a local dev box.


is what should be used.

-p

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
what is pathtoimage ... is that the relative path?

how will I refer to "D:\Product\Images\orange.jpg" on the server within a URL

pathtoimage is NOT "D:\Product\Images\" or is it?
 
Not sure id I'm understanding you correctly but as long as the file you want is on the server you can use a path like this.

Say you webpage is on D:\Webpage\Pages\page.htm and your image is on D:\Product\Images\image.jpg you can use this as the ImageURL...

ImgProduct.ImageURL="../../Product/Images/orange.jpg"

The '../' parts will move back up a level in the directory tree


Steve Gordon
 
Thanks link9,

Seems like a simple thing, but was struggling with it for a while. Nice simple explination!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top