Urgent: Custom Control

  • Thread starter Thread starter James T.
  • Start date Start date
J

James T.

Hello!

I am developing a custom server control that inherits from Hyperlink web
control.

I defined 2 new properties - ImageWidth and ImageHeight. My qustion is, how
I can override Render method so if Hyperling ImageUrl is set then add
ImageWitdh and ImageHeight attributes to image.

Thank you!
James
 
Hi James:

My suggestion would be to add the attributes to the Attributes
collection of the control - the inherited functionality will take care
of rendering the attributes you specify in this collection.
 
Could you please provide me an example?

James
Hi James:

My suggestion would be to add the attributes to the Attributes
collection of the control - the inherited functionality will take care
of rendering the attributes you specify in this collection.
 
Hi James:

You might want to take a look at Reflector [1] and see the source code
to for rendering the HyperLink (it's in RenderContents). The code is
pretty straightforward, and you could actually override the method and
duplicate the code to add a couple lines and set the Image control
properties.

Do you know how to override a method? What language are you using?

[1] http://www.aisto.com/roeder/dotnet/
 
Back
Top