Problem with custom LinkButton and AddAttributesToRender

H

Henri

Hi,

I'm trying to design a custom LinkButton.
It inherits LinkButton as I need the implementation of the Click event (and
I don't know how to rewrite it).
I have to use AddAttributesToRender to render all the style attributes and
properties.
But as I want to specifie my own href attribute, I can't use LinkButton's
default AddAttributesToRender as it automatically adds its own href
attribute.
It would be great if I could call only WebControl's AddAttributesToRender
(LinkButton's parent class) but it doesn't seem possible to call it from my
class as it inherits LinkButton.
So do I need to rewrite completely WebControl's AddAttributesToRender
implementation to get rid of the href attribute added by LinkButton?
Do you have any solution?
Thanks

Henri
 
M

Martin Dechev

Hi, Henri,

Most probably it will be possible to achieve what you need to do using
Attributes.Add("onclick", "...") on the instance instead of altering the
href attribute.

Hope this helps
Martin
 
H

Henri

Thanks Martin

Martin Dechev said:
Hi, Henri,

Most probably it will be possible to achieve what you need to do using
Attributes.Add("onclick", "...") on the instance instead of altering the
href attribute.

Hope this helps
Martin
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top