Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CSS and ASP:LinkButton woes
Message
From
23/02/2007 10:06:42
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01192606
Message ID:
01198303
Views:
11
This message has been marked as the solution to the initial question of the thread.
>Hello World,
> I am having some major heartburn with linkbuttons. The problem is that I want the disabled linkbuttons to display with black text *NOT* grey. I know linkbuttons are rendered as anchor tags so I wrote my CSS like so:
>
>
>a[Disabled] {
>  	color: #FF0000;
>	font-weight: bold;
>	text-decoration: none;
>    FONT-SIZE: 22px;
>}
>
>
>The color attribute is the only attribute that doesn't work. It is simply disregarded by the browser. I set the size to 22 to be sure It was "Listening" ... The bold and size display correctly but not the color.
>
>I also tried programatically setting the properties in code behind with the same results... Grey text I have tested this with inline code on a page with one disabled linkbutton control.
>
>My humble thanks in advance,

The real answer to this is to make the text of the linkbutton a span so you can control color. this closes the linkbutton tag creates a span and opens a new anchor. remember the linkbutton is rendered as a simple anchor on the client so the following is valid. Not as pretty as we would want but since Microsoft seems to know better than we do what our disabled controls should look like ...
lbX.Text = "</a><span class=\"PageLinkDisabled\">" + lbX.Text + "</span><a href=#>";
Hope this helps some one out there,
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Reply
Map
View

Click here to load this message in the networking platform