Reputation: 25099
I am trying to concatenate image url (string) with img tag but i am not sure how to put " after src=. Please help to concatenate this.
response.write("<img src=" & '"' & rs("ProductImage") & '"' &" /><br/>")
Upvotes: 8
Views: 41377
Reputation: 406
Another option is to use the chr function:
Response.Write("<img src=" & chr(34) & rs("ProductImage") & chr(34) & " /><br/>")
ascii code 34 is the double quote. We use this all the time when writing out HTML.
Upvotes: 1
Reputation: 19870
Since HTML can use double quotes or single quotes, why not just use single quotes for the HTML. So your code would look like this:
response.write("<img src='" & rs("ProductImage") & "' /><br/>")
The resulting output would look like this:
<img src='ProductImageUrl' /><br/>
Upvotes: 3
Reputation: 64645
You have to double up the quotes:
Response.Write("<img src=""" & rs("ProductImage") & """ /><br/>")
Upvotes: 12