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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image not visible in Image Control

Status
Not open for further replies.

Waynest

Programmer
Joined
Jun 22, 2000
Messages
321
Location
GB
Hi

I've developed a simple asp.net app (my 1st :)) for deployment onto our intranet.

At the moment the app resides solely on my pc where I have developed it.

I've just opened the page from a browser on another pc and an image control on the page has not displayed the desired image (just a red cross).

The image URL is set to:

file:///D:\My Documents\My Pictures\MercurySymbol_T.gif

It displays ok on my own pc. Any ideas?

Many thanks
 
My first idea is that the file does not exist on that path on the webserver. The second is that the ASPNet user does not have access to that folder (which it probably doesn't). What you need to do is have a directory under your application root folder in which you store the images. In this case lets call it myimages. You then can generate the correct path using the Server.MapPath function to get the correct path to the folder. You then concatenate the file name onto the end i.e.

Code:
Dim filename as string = ""
filename = Server.MapPath("myimages")
filename &= "\myimage.jpg"

Hope this helps,

James :-)

James Culshaw
james@miniaturereview.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top