views:

232

answers:

1

i am creating a table in vb.net code (htmltable) with htmltablerows and htmltablecell. I gave on image control but thatr control cant have the .imageurl property, which i need cause i have a handler image.ashx which brings image from the database. heres' the code -

TD = New HtmlTableCell Dim img As New HtmlImage() img.ID = "image_" & rd("ID") img.Style.Add("width", "100px") img.Style.Add("height", "100px") img.ImageUrl = "Image.ashx?id=" & rd("ID")

on the last line, "img.ImageUrl" i get this error - 'ImageUrl' is not a member of 'System.Web.UI.HtmlControls.HtmlImage' how do i fix this?

+1  A: 

ImageUrl is a member of the System.UI.WebControls.Image control. By contrast, you are using the direct HtmlImage control which is rendered exactly as an img tag would be. You should use the Src property of the HtmlImage control instead.

Steve Danner