RESPONSE.WRITE DOESN'T DISPLAY IMAGE

Royce Roy

Total Post:149

Points:1043
Posted by  Royce Roy
VB.Net 
 1080  View(s)
Ratings:
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

response.write("hello"),

it works fine.

Your help is greatly appreciated.
  1. AVADHESH PATEL

    Post:604

    Points:4228
    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 & "'/>")


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!