Advertise with us

Response.write doesn't display image

Posted by  Royce Roy
 1562  View(s)
Rate this:
Hi Mindstickians,

I want to display a generated image as following line of code in VB.NET

Response.Write("<img src='" & filepather & "'/>")

Where filepather is defined as the string to the image. It is the correct filepath, and I'm not getting the "broken image link" icon.

script inside an aspx page.

Have I forgotten something here? If I do


it works fine.

Your help is greatly appreciated.
  1. Re: Response.write doesn't display image

    Hi Royce,

    Make sure filepather string contains the virtual address of the image not the physical address.

    Like I have tested this and works fine.

    Dim filePath As String = "http://localhost:2025/Styles/Images/logo.png"
    Response.Write("<img src='" & filePath & "'/>")