all groups > asp.net webcontrols > october 2003 >
You're in the

asp.net webcontrols

group:

Change "Enabled" appearance for a LinkButton


Change "Enabled" appearance for a LinkButton Nils M. Lunde
10/30/2003 12:20:30 PM
asp.net webcontrols:
Hi!

I'm trying to make a LinkButton appear black and not dimmed when disabled.
To accomplish this I tried to override the Enabled property, but wthout
any luck.
No matter what I do in my derived property, the control remains dimmed.

How can I make the disabled LinkButton appear black, or
alternatively turn the LinkButton into a non-clickable black text field?

Thanks in advance!

----
Nils Magne Lunde
Re: Change "Enabled" appearance for a LinkButton HD
10/30/2003 4:15:34 PM
i think the code that is generated if the link button is disabled is just
<span style="">your text</span> whereas if active its is <a href="">your
text</a>
y not use inherit from linkbutton and in render method use whatever output
you fancy instead of say <span></span> with greyed out text

HD

[quoted text, click to view]

Re: Change "Enabled" appearance for a LinkButton Nils M. Lunde
10/31/2003 10:07:43 AM

That worked like a charm!

....but I still don't understand why the text is greyed out when I inherit
the Enabled property.
If I don't set MyBase.Enabled to false, how can the program know that it
should print the text greyed out?

Well, now it works anyway :-)
Thanx!

-Nils Magne

[quoted text, click to view]



--
Re: Change "Enabled" appearance for a LinkButton James Radke
10/31/2003 4:19:17 PM
Nils,

I am looking at doing the same thing.. do you have a sample of your new
Class you created inherited from the LinkButton? Would you be willing to
share this?

Thanks

Jim

[quoted text, click to view]

AddThis Social Bookmark Button