Stopping a LinkButton from being greyed out when disabled in IE
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="开发者_JS百科LB_Click" Text="Add" />
(Using .NET 4 and C#) Thanks.
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);
}
精彩评论