views:

15

answers:

1

I'm trying to make it so that a LinkButton doesn't get greyed out in IE when Enabled="False". Disabling the postback like they suggest here and here works but doesn't stop the cursor and text colour from changing when you hover over it as if it were a button, like Enabled="False" does.

<asp:LinkButton ID="LinkBut1" runat="server" CssClass="Tag" Enabled="False" 
            OnClick="LB_Click" Text="Add" />

(Using .NET 4 and C#) Thanks.

A: 

Have you considered extending the LinkButton class, overwriting the Rend method and doing something like:

    protected override void Render(HtmlTextWriter writer)
    {
        if (!this.enabled)
          ...write an html span that looks like a link or something ...
        else
          base.Render(writer);
    }
asawyer