Hi Allan,
I've consulted your question, it seems IE doesn't support the CSS attribute
selector when you use strict mode by using <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">, but
only some certain styles are supported to change at this time, the color of
the disabled elements are unfortunately not changed by the styles:
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"
http://www.w3.org/TR/html4/strict.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
Link1.Enabled = !Link1.Enabled;
}
protected void Button2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(Link1.Attributes["OnClick"]))
{
Link1.Attributes["OnClick"] = "return false;";
Link1.BackColor = System.Drawing.Color.Gray;
}
else
{
Link1.Attributes.Remove("OnClick");
Link1.BackColor = System.Drawing.Color.Empty;
}
}
</script>
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
a[disabled] {
color: red;
text-decoration: none;
font-family: Arial, Helvetica;
font-size: 26px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="Link1" runat="Server" Text="A Link"
ForeColor="Red"></asp:LinkButton>
<br />
<asp:Button ID="Button1" runat="server" Text="Button"
OnClick="Button1_Click" />
<br />
<asp:Button ID="Button2" runat="server" Text="Button2"
OnClick="Button2_Click" />
</div>
</form>
</body>
</html>
Using above page, you can see the link's size changed when it's disabled,
which means the css selector is working, but the color is not changed due
to the by design behavior.
I'm sorry that I cannot find a more appropriate workaround for you.
Regards,
Walter Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.