I am using the below code to add Images and I would like to set width and height of an Image.
How do I add to the existing code:
Dim urls As New List(Of String)
urls.Add("~/DownloadedImages/" & Session("tempDir").ToString & "/" & filename
For Each imageURL As String In urls
Me.FinalPreview.Controls.Add(New System.Web.UI.WebControls.Image() With {.ImageUrl = imageURL})
Next imageURL
I’m not sure about VB syntax but the image control has a Height and Width properties that I think will render as the
heightandwidthattributes of the image tag itself. So try passing those the same way you specified theImageUrlproperty when constructing the control.