I am trying to dynamically change properties on an Image and then render the image to the browser. RenderControl looks like it would do the trick but I can't figure out how to use the HTMLTextWriter.
If possible, I would also like perform some functionality like Response.Write but this doesn't appear to work from a class.
The two pieces ofCode that I have tried to use
Can somebody please explain how to do this?
Thanks Si.
If possible, I would also like perform some functionality like Response.Write but this doesn't appear to work from a class.
The two pieces ofCode that I have tried to use
Code:
'=========================
Sub WriteImage()
Dim m_imgRightLogo As System.Web.UI.WebControls.Image
m_imgRightLogo = New System.Web.UI.WebControls.Image()
m_imgRightLogo.ImageUrl = "img/logo.gif"
m_imgRightLogo.AlternateText = "This is the main logo"
'This is where the problem is - Object reference not set to an instance of an object
Dim wrtrHTML As HtmlTextWriter
m_imgRightLogo.RenderControl(wrtrHTML)
End Sub
'=========================
Sub WriteText()
'Error here - Name response is not declared
Response.Write("Here is Some text")
End Sub
Can somebody please explain how to do this?
Thanks Si.