Search code examples
asp.netcsslinkbutton

Disable linkbuttons in ASP.NET 4.0 when other CSS Classes are being used


I'll try to explain my problem.

I have this linkbutton with a CssClass:

<asp:LinkButton 
    ID="test"
    Text="delete"
    CssClass="button blue"
    OnClick="DeleteMessage_Click"
    runat="server" />

When I disable this linkbutton the class is rendered like this:

<a id="test" class="aspNetDisabled button blue">delete</a>

aspNetDisabled is the first class. Now I want to make the button look grey but after the aspNetDisabled style is the button style and the blue style so the button is never going to be grey.

Is it possible to render aspNetDisabled last, after the button style and the blue style?


Solution

  • Have you tried something like this:

    a.button
    {
       color: gray !important;
    }
    

    Just out of curiosity, what is the blue class for, if you want to make the button gray?