Why are linkbuttons not grayed out when disabled in FireFox?

后端 未结 5 1711
星月不相逢
星月不相逢 2021-02-06 02:39

Why when I set enabled=false on a button does it not render correctly in Firefox? Instead of graying out the link it is still blue.

[UPDATE]

ASP.net already rem

5条回答
  •  花落未央
    2021-02-06 02:50

    In C#, I found that an extension is the most helpful to create a cross-browser solution.

    public static class Extensions
    {
        public static void Disable(this HtmlAnchor obj)
        {
            obj.Attributes.Remove("href");
            obj.Attributes.Add("disabled", "true");
            obj.Style.Add("color", "gray");
        }
    }
    

提交回复
热议问题