Serve images in public folder from ASP.NET application RRS feed

  • Question

  • User251409357 posted

    My application resides in c:\inetpub\wwwroot\images and from this application I want to serve pictures located on another folder, i.e. c:\pictures. How can I do this?

    imgPicture.ImageUrl = ???

    hlkHyperlink.NavigateUrl = ???

    Thanks in advance for your help.






    Friday, December 19, 2008 6:28 PM


  • User123465251 posted

     You have several options:

    a) Create a virtual directory (ie:pictures) in the IIS inside your application so it points to c:\picture, and then your links would be like this "~/pictures/yourpicture.ext

    b) Create a page or similar mechanism that recieves a name of an image and then you serve it using the function Response.TransmitFie(filename)

    If it was possible I would use a)

    Hope this helps


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 19, 2008 9:42 PM