-2

This is my image Url

string fileUrl = file.Link;

I want to show this on Response.Write.How to do it?

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

Above Code I tried.But it doesn't work.

Nivin V Joseph
  • 12,042
  • 2
  • 15
  • 24

3 Answers3

3

And it was that &... It works fine by replacing & with +..

Response.Write("<img src='" + fileUrl+ "'/>")
Nivin V Joseph
  • 12,042
  • 2
  • 15
  • 24
0

let the filePath contain virtual address like shown

string filePath  = "http://localhost:2053/Styles/Images/myPersonalImage.jpg"
Response.Write("<img src='" & filePath & "'/>");
manish
  • 1,450
  • 8
  • 13
  • Image is not on local host.I'm taking it from an external site. I successfully stored the image on my local machine. But I need to show it in my project – Nivin V Joseph Nov 21 '14 at 11:24
0

You need to use Server.MapPath.

string fileUrl = Server.MapPath(file.Link);
Black Frog
  • 11,595
  • 1
  • 35
  • 66