N
Nathan Sokalski
I have a custom control that inherits from System.Web.UI.WebControls.Image.
When overriding the RenderContents method, I include the following lines of
code:
Me.ImageUrl="myurlstring"
MyBase.RenderContents(writer)
However, when I run the control, it renders the following:
<img src="" style="border-width:0px;" />
Notice that the "src" attribute has an empty string as it's value. However,
when I ran the debugger, it showed that the specified value did get assigned
to Me.ImageUrl, so I would expect it to render:
<img src="myurlstring" style="border-width:0px;" />
I have tried this same test with other properties such as AlternateText, and
the same thing happened (they did not render). However, I once wrote a
custom control that inherited System.Web.UI.WebControls.DropDownList in
which I override RenderContents the same way (I set an inherited property
using Me.Property=Value and then call MyBase.RenderContents(writer)), and
that worked fine. Why is it not working here? Any help would be appreciated.
Thanks.
When overriding the RenderContents method, I include the following lines of
code:
Me.ImageUrl="myurlstring"
MyBase.RenderContents(writer)
However, when I run the control, it renders the following:
<img src="" style="border-width:0px;" />
Notice that the "src" attribute has an empty string as it's value. However,
when I ran the debugger, it showed that the specified value did get assigned
to Me.ImageUrl, so I would expect it to render:
<img src="myurlstring" style="border-width:0px;" />
I have tried this same test with other properties such as AlternateText, and
the same thing happened (they did not render). However, I once wrote a
custom control that inherited System.Web.UI.WebControls.DropDownList in
which I override RenderContents the same way (I set an inherited property
using Me.Property=Value and then call MyBase.RenderContents(writer)), and
that worked fine. Why is it not working here? Any help would be appreciated.
Thanks.