C# Webpage image file

What is the correct location of the file, and the best way to link an image for a webpage so that it is viewable to all

Answer this question

C# Webpage image file

  • GLM

    So in C# when I add the image and I go to browse for the file... I should just replace the

    file:///S:\MImages\Logos\Logos\Custconnects.jpg

    with (this is a web application for internal use only)

    Thanks,


  • karthikeyan.A

    best way to link the image is to give relative path like "~/Website/Images/Image1.jpg", instead of giving absolute path like "C:\Inetpub\wwroot\Website\Images\Images1.jpg"


  • MaHMouD 2006

    i think you are working with ASP.Net 1.0/1.1, so when you attach a picture to a picture box , there is a option about the path type i.e. relative, absolute ... etc.




  • Access Denied

    I am actually working with C#.net 2003
  • Chris2006

    Ok, in this version , when you set the ImageUrl Property of a Image, there is a option of URL Type, select the url type as root relative.

    Make sure that your pictures are in the Website Folder.


  • C# Webpage image file