这是我的 JavaScript 代码。在加载功能上,我必须禁用 btndelete ..它在 iE 中可以正常工作,但在 Firefox 中,buton 不是 dsabled..我不知道这是 CSS 问题还是什么?
Javascript
window.onload = body_Onload;
function body_Onload()
{
var btnDelete = document.getElementById('<%=btnDelete.ClientID%>');
btnDelete.disabled = true;
}
HTML
<asp:Button ID="btnDelete" runat="server" CssClass="cssbutton" Text="Delete" Width="60px" OnClick="btnDelete_Click" />
CSS
.cssbutton
{
font-weight: bold;
border-right: #3C8FD1 1px solid;
border-top: #3C8FD1 1px solid;
border-left: #3C8FD1 1px solid;
border-bottom: #3C8FD1 1px solid;
font-size: 10px;
color: #045FA7;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
background-image: url(../App_Images/cssbuttonbg.gif);
line-height: 14px;
}
HTML 生成的代码
<input type="submit" name="pageMain$contentPlaceHolderMain$btnDelete"
value="Delete" onclick="return btnDelete_Click();"
id="contentPlaceHolderMain_btnDelete" class="cssbutton" style="width:60px;"/>