Is this possible??
I have a server control which renders a div, and inside the div I want to display the "avatar" for the supplied object.
Simplified example of the RenderContents method of the server control.
I have a server control which renders a div, and inside the div I want to display the "avatar" for the supplied object.
Simplified example of the RenderContents method of the server control.
| protected override void RenderContents(HtmlTextWriter writer) |
| { |
| writer.RenderBeginTag(HtmlTextWriterTag.Div); |
| RadBinaryImage image = new RadBinaryImage(); |
| image.DataValue = customer.Avatar; //byte array |
| image.Width = image.Height = Unit.Pixel(80); |
| image.AlternateText = customer.Name; |
| //image.DataBind(); |
| image.RenderControl(writer); writer.WriteLine(); writer.RenderEndTag(); |
| } |
When the control is rendered on the page, the image shown is the browsers default image not found placeholder. I know the customer object being used in the test has an avatar specified so the DataValue property should be set correctly.
I tried calling databind also because all the examples show it being used in a databound control, but that didnt seem work either.
Let me know if I'm doing something wrong or if this is just not supported.
Thanks,
Adam