Urgent: Custom Control

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
 
S

Scott Allen

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.
 
J

James T.

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.
 
S

Scott Allen

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top