所以我有一個按鈕,目前設置爲禁用,並在IE中它是灰色,但在Firefox,Chrome和Safari,它被禁用,但仍然看起來活躍。按鈕禁用,但看起來活躍
按鈕代碼
<tr valign="middle">
<td colspan="2" style="width: 100%">
<asp:Button ID="DownloadButton" runat="server" Text="Download" Width="85px" CssClass="ESTableHeaderL" OnClick="DownloadButton_Click" />
</td>
</tr>
而且我的身後
protected void DownloadButton_Click(object sender, EventArgs e)
{
if (ddBusinessMonth.Items.Count == 0)
{
DownloadButton.Enabled = false;
ShowClientMessageBox("No Data found for downloading");
}
....
}
代碼有什麼我可以做,使之看起來一樣在IE?
感謝
,允許它被禁用,但在瀏覽器中它不灰色出來 – TheLifeOfSteve
每個瀏覽器都有自己的默認樣式。然而,你可以強制你自己的風格。爲此,您必須創建自定義CSS類並將其應用於您的意願 – JSantos
什麼是ESTableHeaderL的CSS?這可能會導致問題,因爲每個瀏覽器都有一些默認的禁用按鈕樣式。可能你已經以某種方式重新定義了它 –