my need is to display an image in a web page using string builder. i know through this snippet sb.Append("<a href=\"http://www.mypage.com\"><img src=\"bla.jpg\" /></a>");
i can display an image. Here my problem is that the image path is dynamically generated and is in a string
variable.
following is the code i tried:
Dim table_builder As New StringBuilder
table_builder.Append("<table width=100%>")
Dim filePath As String = Server.MapPath("../attachments/") & fileName
// file name is the name of the file fetching from the database
table_builder.Append("<tr>")
table_builder.Append("<td>")
table_builder.Append("<img src='" + filePath + "'/>")
table_builder.Append("</td>")
table_builder.Append("</tr>")
But it does not show the image through executing the code
table_builder.Append("</table>")
attach.innerHTML = table_builder.ToString()