我有一个和上一个按钮为这么DataPager的:
<asp:DataPager ID="dpFeaturedPager" PagedControlID="lvFeaturedTips" QueryStringField="ftpg" PageSize="1" runat="server">
<Fields>
<asp:nextpreviouspagerfield ButtonCssClass="featured-previous" PreviousPageText="Previous" ShowNextPageButton="false" />
<asp:nextpreviouspagerfield ButtonCssClass="featured-next" NextPageText="Next" ShowPreviousPageButton="false" />
</Fields>
</asp:DataPager>
当只有一个页面可用,下一个和以前的链接都呈现为这样:
<a disabled="disabled">Previous</a>
我之前没有见过这个禁用标签,并设定它是从哪个我就无法控制DataPager控件来。
像往常一样,这是罚款,火狐,但在IE7上一页和下一页文本不正确呈现 - 它概述(我期望残疾人的样子,说实话 - !不过看起来有点页面丑)
我可以在CSS控制这一点,还是这是一个已知的问题?
由于邓肯
检查出StackOverflow这个线程,它们对CSS样式为残疾人链接和控制提出了一些建议。希望能帮助到你!
a[disabled=disabled] {
color: red;
font-weight: bold;
border: 0px;
}
编辑:看起来不像选择属性将在IE6工作。
你不能在IE中设置禁用的控件的颜色。你可以改变背景或边框,但颜色将永远留灰色与白色的影子(系统颜色)。它不会在IE9甚至不工作。线程这个问题:How to change color of disabled html controls in IE8 using css。
使用jQuery removeAttr()快速的解决方案:
$('a').removeAttr('disabled');
这个:
<a disabled="disabled">Sad</a>
成为本:
<a>Happy</a>
我添加了一个类“btnDisable”的双方下一个和以前的链接,然后使用CSS ...
span .btnDisable {cursor: not-allowed; }
span a.btnDisable {cursor: pointer; }
只要确保你设置RenderDisabledButtonsAsLabels为True。
对于那些仍在寻找这个问题,从.NET 4.0中,您必须在web.config中定义文件为.NET控件的HTML兼容的可能性。
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
然后在Global.asax.cs中,你可以指定CSS类.NET应适用于残疾人的控制。
System.Web.UI.WebControls.WebControl.DisabledCssClass = "disabled";