Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Style a Disabled ASP.NET Buttons

Tags:

css

asp.net

I have an asp button that I am styling using CSS.

Button:

<asp:Button ID="btnClockin" runat="server" Text="Clock In" class="FullWidthButton" />

CSS:

.FullWidthButton {width:100%;}

This works fine until I set btnClockIn.Enabled = False in my code, then it doesn't pick up the style. I tried adding the following CSS.

.FullWidthButton[disabled="disabled"]{width:100%;}

and

.FullWidthButton[disabled]{width:100%;}

but these don't seem to have any effect. What am I doing wrong?

like image 239
Matt Wilko Avatar asked Dec 27 '22 21:12

Matt Wilko


1 Answers

Change "class" to "CssClass" and it should work consistently.

like image 122
Jaime Torres Avatar answered Dec 29 '22 09:12

Jaime Torres